mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
Convert informal TODO and FIXME comments to Doxygen-recognized
\todo format.
- // TODO comments → //! \todo ...
- // FIXME comments → //! \todo ...
- /** @todo ... */ blocks → //! \todo ...
- @brief TODO: placeholders → //! \todo (moved outside doc blocks)
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
/**
|
|
* @file overlap_layout.h
|
|
* @ingroup UI
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef OVERLAP_LAYOUT_H
|
|
#define OVERLAP_LAYOUT_H
|
|
|
|
#include <QLayout>
|
|
#include <QList>
|
|
#include <QLoggingCategory>
|
|
#include <QWidget>
|
|
|
|
inline Q_LOGGING_CATEGORY(OverlapLayoutLog, "overlap_layout");
|
|
|
|
class OverlapLayout : public QLayout
|
|
{
|
|
public:
|
|
OverlapLayout(QWidget *parent = nullptr,
|
|
int overlapPercentage = 10,
|
|
int maxColumns = 2,
|
|
int maxRows = 2,
|
|
Qt::Orientation overlapDirection = Qt::Vertical,
|
|
Qt::Orientation flowDirection = Qt::Horizontal);
|
|
~OverlapLayout();
|
|
void insertWidgetAtIndex(QWidget *toInsert, int index);
|
|
|
|
void addItem(QLayoutItem *item) override;
|
|
[[nodiscard]] int count() const override;
|
|
[[nodiscard]] QLayoutItem *itemAt(int index) const override;
|
|
QLayoutItem *takeAt(int index) override;
|
|
void setGeometry(const QRect &rect) override;
|
|
[[nodiscard]] QSize minimumSize() const override;
|
|
[[nodiscard]] QSize sizeHint() const override;
|
|
void setMaxColumns(int _maxColumns);
|
|
void setMaxRows(int _maxRows);
|
|
[[nodiscard]] int calculateMaxColumns() const;
|
|
[[nodiscard]] int calculateRowsForColumns(int columns) const;
|
|
[[nodiscard]] int calculateMaxRows() const;
|
|
[[nodiscard]] int calculateColumnsForRows(int rows) const;
|
|
void setDirection(Qt::Orientation _direction);
|
|
|
|
private:
|
|
QList<QLayoutItem *> itemList;
|
|
int overlapPercentage;
|
|
int maxColumns;
|
|
int maxRows;
|
|
Qt::Orientation overlapDirection;
|
|
Qt::Orientation flowDirection;
|
|
|
|
// Calculate the preferred size of the layout
|
|
[[nodiscard]] QSize calculatePreferredSize() const;
|
|
};
|
|
|
|
#endif // OVERLAP_LAYOUT_H
|