#include <flow_layout.h>
Public Member Functions | |
| FlowLayout (QWidget *parent=nullptr) | |
| FlowLayout (QWidget *parent, Qt::Orientation _flowDirection, int margin=0, int hSpacing=0, int vSpacing=0) | |
| Constructs a FlowLayout instance with the specified parent widget, margin, and spacing values. | |
| ~FlowLayout () override | |
| Destructor for FlowLayout, which cleans up all items in the layout. | |
| void | insertWidgetAtIndex (QWidget *toInsert, int index) |
| QSize | calculateMinimumSizeHorizontal () const |
| Calculates the minimum size for horizontal flow direction. | |
| QSize | calculateSizeHintVertical () const |
| Calculates the size hint for vertical flow direction. | |
| QSize | calculateMinimumSizeVertical () const |
| Calculates the minimum size for vertical flow direction. | |
| void | addItem (QLayoutItem *item) override |
| Adds a new item to the layout. | |
| int | count () const override |
| Retrieves the count of items in the layout. | |
| QLayoutItem * | itemAt (int index) const override |
| Returns the layout item at the specified index. | |
| QLayoutItem * | takeAt (int index) override |
| Removes and returns the item at the specified index. | |
| int | horizontalSpacing () const |
| Gets the horizontal spacing between items. | |
| Qt::Orientations | expandingDirections () const override |
| Indicates the layout's support for expansion in both horizontal and vertical directions. | |
| bool | hasHeightForWidth () const override |
| Indicates that this layout's height depends on its width. | |
| int | heightForWidth (int width) const override |
| Calculates the required height to display all items within the specified width. | |
| int | verticalSpacing () const |
| Gets the vertical spacing between items. | |
| int | doLayout (const QRect &rect, bool testOnly) const |
| int | smartSpacing (QStyle::PixelMetric pm) const |
| Calculates smart spacing based on the parent widget style. | |
| int | getParentScrollAreaWidth () const |
| Gets the width of the parent scroll area, if any. | |
| int | getParentScrollAreaHeight () const |
| Gets the height of the parent scroll area, if any. | |
| void | setGeometry (const QRect &rect) override |
| Arranges layout items in rows within the specified rectangle bounds. | |
| virtual int | layoutAllRows (int originX, int originY, int availableWidth) |
| Lays out items into rows according to the available width, starting from a given origin. Each row is arranged within availableWidth, wrapping to a new row as necessary. | |
| virtual void | layoutSingleRow (const QVector< QLayoutItem * > &rowItems, int x, int y) |
| Arranges a single row of items within specified x and y starting positions. | |
| int | layoutAllColumns (int originX, int originY, int availableHeight) |
| Lays out items into columns according to the available height, starting from a given origin. Each column is arranged within availableHeight, wrapping to a new column as necessary. | |
| void | layoutSingleColumn (const QVector< QLayoutItem * > &colItems, int x, int y) |
| Arranges a single column of items within specified x and y starting positions. | |
| QSize | sizeHint () const override |
| Calculates the preferred size of the layout based on the flow direction. | |
| QSize | minimumSize () const override |
| Calculates the minimum size required by the layout based on the flow direction. | |
| QSize | calculateSizeHintHorizontal () const |
| Calculates the size hint for horizontal flow direction. | |
Protected Attributes | |
| QList< QLayoutItem * > | items |
| Qt::Orientation | flowDirection |
| int | horizontalMargin |
| int | verticalMargin |
|
explicit |
| FlowLayout::FlowLayout | ( | QWidget * | parent, |
| Qt::Orientation | _flowDirection, | ||
| int | margin = 0, | ||
| int | hSpacing = 0, | ||
| int | vSpacing = 0 ) |
Constructs a FlowLayout instance with the specified parent widget, margin, and spacing values.
| parent | The parent widget for this layout. |
| margin | The layout margin. |
| hSpacing | The horizontal spacing between items. |
| vSpacing | The vertical spacing between items. |
|
override |
Destructor for FlowLayout, which cleans up all items in the layout.
|
override |
Adds a new item to the layout.
| item | The layout item to add. |
|
nodiscard |
Calculates the minimum size for horizontal flow direction.
|
nodiscard |
Calculates the minimum size for vertical flow direction.
|
nodiscard |
Calculates the size hint for horizontal flow direction.
|
nodiscard |
Calculates the size hint for vertical flow direction.
|
nodiscardoverride |
Retrieves the count of items in the layout.
|
nodiscard |
|
nodiscardoverride |
Indicates the layout's support for expansion in both horizontal and vertical directions.
|
nodiscard |
Gets the height of the parent scroll area, if any.
|
nodiscard |
Gets the width of the parent scroll area, if any.
|
nodiscardoverride |
Indicates that this layout's height depends on its width.
|
nodiscardoverride |
Calculates the required height to display all items within the specified width.
| width | The available width for arranging items. |
|
nodiscard |
Gets the horizontal spacing between items.
| void FlowLayout::insertWidgetAtIndex | ( | QWidget * | toInsert, |
| int | index ) |
|
nodiscardoverride |
Returns the layout item at the specified index.
| index | The index of the item to retrieve. |
| int FlowLayout::layoutAllColumns | ( | int | originX, |
| int | originY, | ||
| int | availableHeight ) |
Lays out items into columns according to the available height, starting from a given origin. Each column is arranged within availableHeight, wrapping to a new column as necessary.
| originX | The x-coordinate for the layout start position. |
| originY | The y-coordinate for the layout start position. |
| availableHeight | The height within which each column is constrained. |
|
virtual |
Lays out items into rows according to the available width, starting from a given origin. Each row is arranged within availableWidth, wrapping to a new row as necessary.
| originX | The x-coordinate for the layout start position. |
| originY | The y-coordinate for the layout start position. |
| availableWidth | The width within which each row is constrained. |
| void FlowLayout::layoutSingleColumn | ( | const QVector< QLayoutItem * > & | colItems, |
| int | x, | ||
| int | y ) |
Arranges a single column of items within specified x and y starting positions.
| colItems | A list of items to be arranged in the column. |
| x | The starting x-coordinate for the column. |
| y | The starting y-coordinate for the column. |
|
virtual |
Arranges a single row of items within specified x and y starting positions.
| rowItems | A list of items to be arranged in the row. |
| x | The starting x-coordinate for the row. |
| y | The starting y-coordinate for the row. |
|
nodiscardoverride |
Calculates the minimum size required by the layout based on the flow direction.
|
override |
Arranges layout items in rows within the specified rectangle bounds.
| rect | The area within which to position layout items. |
|
nodiscardoverride |
Calculates the preferred size of the layout based on the flow direction.
|
nodiscard |
Calculates smart spacing based on the parent widget style.
| pm | The pixel metric to calculate. |
|
override |
Removes and returns the item at the specified index.
| index | The index of the item to remove. |
|
nodiscard |
Gets the vertical spacing between items.
|
protected |
|
protected |
|
protected |
|
protected |