7#ifndef OVERLAP_LAYOUT_H
8#define OVERLAP_LAYOUT_H
12#include <QLoggingCategory>
29 void addItem(QLayoutItem *item)
override;
30 [[nodiscard]]
int count()
const override;
31 [[nodiscard]] QLayoutItem *
itemAt(
int index)
const override;
32 QLayoutItem *
takeAt(
int index)
override;
35 [[nodiscard]] QSize
sizeHint()
const override;
void insertWidgetAtIndex(QWidget *toInsert, int index)
Definition overlap_layout.cpp:57
QSize minimumSize() const override
Provides the minimum size hint for the layout, ensuring functionality within constraints.
Definition overlap_layout.cpp:354
int calculateMaxRows() const
Calculates the maximum number of rows for a horizontal overlap layout based on the current height.
Definition overlap_layout.cpp:452
int maxColumns
Definition overlap_layout.h:47
Qt::Orientation flowDirection
Definition overlap_layout.h:50
int count() const override
Retrieves the total count of items within the layout.
Definition overlap_layout.cpp:94
QList< QLayoutItem * > itemList
Definition overlap_layout.h:45
void setDirection(Qt::Orientation _direction)
Sets the layout's orientation direction.
Definition overlap_layout.cpp:364
QLayoutItem * itemAt(int index) const override
Provides access to a layout item at a specified index.
Definition overlap_layout.cpp:108
void setMaxRows(int _maxRows)
Sets the maximum number of rows for vertical orientation.
Definition overlap_layout.cpp:386
QLayoutItem * takeAt(int index) override
Removes and returns a layout item at the specified index.
Definition overlap_layout.cpp:122
int maxRows
Definition overlap_layout.h:48
int overlapPercentage
Definition overlap_layout.h:46
void setMaxColumns(int _maxColumns)
Sets the maximum number of columns for horizontal orientation.
Definition overlap_layout.cpp:374
Qt::Orientation overlapDirection
Definition overlap_layout.h:49
~OverlapLayout()
Destructor for OverlapLayout, ensuring cleanup of all layout items.
Definition overlap_layout.cpp:49
QSize sizeHint() const override
Returns the size hint for the layout, based on preferred size calculations.
Definition overlap_layout.cpp:341
int calculateMaxColumns() const
Calculates the maximum number of columns for a vertical overlap layout based on the current width.
Definition overlap_layout.cpp:401
int calculateRowsForColumns(int columns) const
Calculates the maximum number of rows needed for a given number of columns in a vertical overlap layo...
Definition overlap_layout.cpp:433
int calculateColumnsForRows(int rows) const
Calculates the maximum number of columns needed for a given number of rows in a horizontal overlap la...
Definition overlap_layout.cpp:487
OverlapLayout(QWidget *parent=nullptr, int overlapPercentage=10, int maxColumns=2, int maxRows=2, Qt::Orientation overlapDirection=Qt::Vertical, Qt::Orientation flowDirection=Qt::Horizontal)
Constructs an OverlapLayout with the specified parameters.
Definition overlap_layout.cpp:32
QSize calculatePreferredSize() const
Calculates the preferred size for the layout, considering overlap and orientation.
Definition overlap_layout.cpp:248
void addItem(QLayoutItem *item) override
Adds a new item to the layout.
Definition overlap_layout.cpp:79
void setGeometry(const QRect &rect) override
Sets the geometry for the layout items, arranging them with the specified overlap.
Definition overlap_layout.cpp:131
Q_LOGGING_CATEGORY(OverlapLayoutLog, "overlap_layout")