QwtDynGridLayout(3)
π NAME π
QwtDynGridLayout(3) from the Library Functions Manual β okay bestie, this is the QwtDynGridLayout class, and its whole vibe is: lays out widgets in a grid, adjusting the number of columns and rows to the current size. Slay. π
β¨
π¦ SYNOPSIS π¦
#include <qwt_dyngrid_layout.h>
Inherits QLayout.
πΈ Public Member Functions πΈ
QwtDynGridLayout (QWidget *, int margin=0, int spacing=-1)QwtDynGridLayout (int spacing=-1)virtual ~QwtDynGridLayout ()β Destructor.virtual void invalidate () overrideβ Invalidate all internal caches.void setMaxColumns (uint maxColumns)uint maxColumns () constβ Return the upper limit for the number of columns.uint numRows () constuint numColumns () constvirtual void addItem (QLayoutItem *) overrideβ Add an item to the next free position.virtual QLayoutItem * itemAt (int index) const overridevirtual QLayoutItem * takeAt (int index) overridevirtual int count () const overridevoid setExpandingDirections (Qt::Orientations)virtual Qt::Orientations expandingDirections () const overrideβ Returns whether this layout can make use of more space thansizeHint().QList< QRect > layoutItems (const QRect &, uint numColumns) constvirtual int maxItemWidth () constvirtual void setGeometry (const QRect &) overridevirtual bool hasHeightForWidth () const overridevirtual int heightForWidth (int) const overridevirtual QSize sizeHint () const overridevirtual bool isEmpty () const overrideuint itemCount () constvirtual uint columnsForWidth (int width) constβ Calculate the number of columns for a given width.
π§ Protected Member Functions π§
void layoutGrid (uint numColumns, QVector< int > &rowHeight, QVector< int > &colWidth) constvoid stretchGrid (const QRect &rect, uint numColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const
πΈ Detailed Description πΈ
The QwtDynGridLayout class lays out widgets in a grid, adjusting the number of columns and rows to the current size. β¨
QwtDynGridLayout takes the space it gets, divides it up into rows and columns, and puts each of the widgets it manages into the correct cell(s). It lays out as many number of columns as possible (limited by maxColumns()). π
π Definition at line 27 of file qwt_dyngrid_layout.h.
π Constructor & Destructor Documentation π
π QwtDynGridLayout::QwtDynGridLayout (QWidget * parent, int margin = 0, int spacing = -1) [explicit] π
Okay so this constructor takes:
parentβ Parent widgetmarginβ Marginspacingβ Spacing
π Definition at line 58 of file qwt_dyngrid_layout.cpp.
π QwtDynGridLayout::QwtDynGridLayout (int spacing = -1) [explicit] π
spacingβ Spacing
π Definition at line 71 of file qwt_dyngrid_layout.cpp.
π QwtDynGridLayout::~QwtDynGridLayout () [virtual] π
Destructor. π«Ά
π Definition at line 88 of file qwt_dyngrid_layout.cpp.
β¨ Member Function Documentation β¨
β¨ void QwtDynGridLayout::addItem (QLayoutItem * item) [override], [virtual] β¨
Add an item to the next free position. π―
itemβ Layout item
π Definition at line 128 of file qwt_dyngrid_layout.cpp.
β¨ uint QwtDynGridLayout::columnsForWidth (int width) const [virtual] β¨
Calculate the number of columns for a given width. The calculation tries to use as many columns as possible ( limited by maxColumns() ). π
widthβ Available width for all columns
Returns: Number of columns for a given width
See also: maxColumns(), setMaxColumns()
π Definition at line 256 of file qwt_dyngrid_layout.cpp.
β¨ int QwtDynGridLayout::count () const [override], [virtual] β¨
Returns: Number of items in the layout
π Definition at line 182 of file qwt_dyngrid_layout.cpp.
β¨ Qt::Orientations QwtDynGridLayout::expandingDirections () const [override], [virtual] β¨
Returns whether this layout can make use of more space than sizeHint(). A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, while Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions. π
Returns: Orientations, where the layout expands
See also: setExpandingDirections()
π Definition at line 211 of file qwt_dyngrid_layout.cpp.
β¨ bool QwtDynGridLayout::hasHeightForWidth () const [override], [virtual] β¨
Returns: true: QwtDynGridLayout implements heightForWidth().
See also: heightForWidth()
π Definition at line 446 of file qwt_dyngrid_layout.cpp.
β¨ int QwtDynGridLayout::heightForWidth (int width) const [override], [virtual] β¨
Returns: The preferred height for this layout, given a width.
See also: hasHeightForWidth()
π Definition at line 455 of file qwt_dyngrid_layout.cpp.
β¨ void QwtDynGridLayout::invalidate () [override], [virtual] β¨
Invalidate all internal caches. π§Ή
π Definition at line 95 of file qwt_dyngrid_layout.cpp.
β¨ bool QwtDynGridLayout::isEmpty () const [override], [virtual] β¨
Returns: true if this layout is empty.
π Definition at line 137 of file qwt_dyngrid_layout.cpp.
β¨ QLayoutItem * QwtDynGridLayout::itemAt (int index) const [override], [virtual] β¨
Find the item at a specific index π
indexβ Index
Returns: Item at a specific index
See also: takeAt()
π Definition at line 157 of file qwt_dyngrid_layout.cpp.
β¨ uint QwtDynGridLayout::itemCount () const β¨
Returns: number of layout items
π Definition at line 145 of file qwt_dyngrid_layout.cpp.
β¨ void QwtDynGridLayout::layoutGrid (uint numColumns, QVector< int > & rowHeight, QVector< int > & colWidth) const [protected] β¨
Calculate the dimensions for the columns and rows for a grid of numColumns columns. π
numColumnsβ Number of columns.rowHeightβ Array where to fill in the calculated row heights.colWidthβ Array where to fill in the calculated column widths.
π Definition at line 419 of file qwt_dyngrid_layout.cpp.
β¨ QList< QRect > QwtDynGridLayout::layoutItems (const QRect & rect, uint numColumns) const β¨
Calculate the geometries of the layout items for a layout with numColumns columns and a given rectangle. π
rectβ Rect where to place the itemsnumColumnsβ Number of columns
Returns: item geometries
π Definition at line 344 of file qwt_dyngrid_layout.cpp.
β¨ uint QwtDynGridLayout::maxColumns () const β¨
Return the upper limit for the number of columns. 0 means unlimited, what is the default. βΎοΈ
Returns: Upper limit for the number of columns
See also: setMaxColumns()
π Definition at line 119 of file qwt_dyngrid_layout.cpp.
β¨ int QwtDynGridLayout::maxItemWidth () const [virtual] β¨
Returns: the maximum width of all layout items
π Definition at line 316 of file qwt_dyngrid_layout.cpp.
β¨ uint QwtDynGridLayout::numColumns () const β¨
Returns: Number of columns of the current layout.
See also: numRows()
β οΈ Warning: The number of columns might change whenever the geometry changes
π Definition at line 596 of file qwt_dyngrid_layout.cpp.
β¨ uint QwtDynGridLayout::numRows () const β¨
Returns: Number of rows of the current layout.
See also: numColumns()
β οΈ Warning: The number of rows might change whenever the geometry changes
π Definition at line 586 of file qwt_dyngrid_layout.cpp.
β¨ void QwtDynGridLayout::setExpandingDirections (Qt::Orientations expanding) β¨
Set whether this layout can make use of more space than sizeHint(). A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, while Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions. The default value is 0. π
expandingβ Or'd orientations
See also: expandingDirections()
π Definition at line 196 of file qwt_dyngrid_layout.cpp.
β¨ void QwtDynGridLayout::setGeometry (const QRect & rect) [override], [virtual] β¨
Reorganizes columns and rows and resizes managed items within a rectangle. π§©
rectβ Layout geometry
π Definition at line 222 of file qwt_dyngrid_layout.cpp.
β¨ void QwtDynGridLayout::setMaxColumns (uint maxColumns) β¨
Limit the number of columns.
maxColumnsβ upper limit,0means unlimited
See also: maxColumns()
π Definition at line 106 of file qwt_dyngrid_layout.cpp.
β¨ QSize QwtDynGridLayout::sizeHint () const [override], [virtual] β¨
Return the size hint. If maxColumns() > 0 it is the size for a grid with maxColumns() columns, otherwise it is the size for a grid with only one row. π
Returns: Size hint
See also: maxColumns(), setMaxColumns()
π Definition at line 550 of file qwt_dyngrid_layout.cpp.
β¨ void QwtDynGridLayout::stretchGrid (const QRect & rect, uint numColumns, QVector< int > & rowHeight, QVector< int > & colWidth) const [protected] β¨
Stretch columns in case of expanding() & QSizePolicy::Horizontal and rows in case of expanding() & QSizePolicy::Vertical to fill the entire rect. Rows and columns are stretched with the same factor. πͺ
rectβ Bounding rectanglenumColumnsβ Number of columnsrowHeightβ Array to be filled with the calculated row heightscolWidthβ Array to be filled with the calculated column widths
See also: setExpanding(), expanding()
π Definition at line 491 of file qwt_dyngrid_layout.cpp.
β¨ QLayoutItem * QwtDynGridLayout::takeAt (int index) [override], [virtual] β¨
Find the item at a specific index and remove it from the layout π
indexβ Index
Returns: Layout item, removed from the layout
See also: itemAt()
π Definition at line 172 of file qwt_dyngrid_layout.cpp.
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Okay bye bestie π«Άπ β this was the Qwt User's Guide page for QwtDynGridLayout(3). The footer on the original just points at Qwt User's Guide and QwtDynGridLayout(3); no extra date is listed here, so thatβs the whole cute sign-off. Slay. β¨
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms