QwtDynGridLayout(3)
QwtDynGridLayout(3) π
okay so bestie, you're reading the QwtDynGridLayout(3) page from the Qwt User's Guide, and it's literally all about a grid layout that's lowkey alive β it changes its rows and columns depending on the size it gets. no cap. π¦
β¨ NAME β¨
QwtDynGridLayout β the dynamic grid layout icon, periodt.
β¨ SYNOPSIS β¨
#include <qwt_dyngrid_layout.h>
Public Member Functions
QwtDynGridLayout (QWidget *, int margin=0, int space=-1)β constructor with a parent widget, a margin, and spacing.QwtDynGridLayout (int space=-1)β constructor with just spacing.virtual ~QwtDynGridLayout ()β destructor, virtual, doing its thing.virtual void addItem (QLayoutItem *)β adds an item.virtual uint columnsForWidth (int width) constβ tells you how many columns fit a given width.virtual int count () constβ number of items in the layout.virtual Qt::Orientations expandingDirections () constβ which directions it wants to expand in.virtual bool hasHeightForWidth () constβ does it implement heightForWidth? yes.virtual int heightForWidth (int) constβ preferred height for a given width.virtual void invalidate ()β invalidates the layout.virtual bool isEmpty () constβ is it empty?virtual QLayoutItem * itemAt (int index) constβ find the item at a specific index.uint itemCount () constβ number of layout items.QList< QRect > layoutItems (const QRect &, uint numCols) constβ calculates item geometries for a rect and number of columns.uint maxCols () constβ upper limit for columns (0 means unlimited).virtual int maxItemWidth () constβ maximum width of all layout items.uint numCols () constβ number of columns in the current layout.uint numRows () constβ number of rows in the current layout.void setExpandingDirections (Qt::Orientations)β set which directions it can expand in.virtual void setGeometry (const QRect &rect)β reorganizes and resizes within rect.void setMaxCols (uint maxCols)β limit the number of columns.virtual QSize sizeHint () constβ the size hint.virtual QLayoutItem * takeAt (int index)β find item at index and remove it.
Protected Member Functions
void layoutGrid (uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) constβ calculates column and row dimensions.void stretchGrid (const QRect &rect, uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) constβ stretches columns and rows to fill the rect.
π 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 maxCols()). it's giving adaptive grid realness, fr fr.
π Constructor & Destructor Documentation π
QwtDynGridLayout::QwtDynGridLayout (QWidget *parent, intmargin = 0, intspacing = -1) [explicit]
Parameters:
parentβ Parent widgetmarginβ Marginspacingβ Spacing
QwtDynGridLayout::QwtDynGridLayout (intspacing = -1) [explicit]
Parameters:
spacingβ Spacing
π Member Function Documentation π
uint QwtDynGridLayout::columnsForWidth (intwidth) const [virtual]
Calculate the number of columns for a given width. It tries to use as many columns as possible (limited by maxCols()). bestie, it's doing the math so you don't have to. β¨
Parameters:
widthβ Available width for all columns
See also:
maxCols(),setMaxCols()
int QwtDynGridLayout::count () const [virtual]
Returns:
- Number of items in the layout
Qt::Orientations QwtDynGridLayout::expandingDirections () const [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.
See also:
setExpandingDirections()
bool QwtDynGridLayout::hasHeightForWidth () const [virtual]
Returns:
true:QwtDynGridLayoutimplementsheightForWidth.
See also:
heightForWidth()
int QwtDynGridLayout::heightForWidth (intwidth) const [virtual]
Returns:
- The preferred height for this layout, given the width
w.
See also:
hasHeightForWidth()
bool QwtDynGridLayout::isEmpty () const [virtual]
Returns:
trueif this layout is empty.
QLayoutItem * QwtDynGridLayout::itemAt (intindex) const [virtual]
Find the item at a spcific index. (yes, original says "spcific", we keep it π)
Parameters:
indexβ Index
See also:
takeAt()
uint QwtDynGridLayout::itemCount () const
Returns:
- number of layout items
void QwtDynGridLayout::layoutGrid (uintnumCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const [protected]
Calculate the dimensions for the columns and rows for a grid of numCols columns.
Parameters:
numColsβ Number of columns.rowHeightβ Array where to fill in the calculated row heights.colWidthβ Array where to fill in the calculated column widths.
QList< QRect > QwtDynGridLayout::layoutItems (const QRect &rect, uintnumCols) const
Calculate the geometries of the layout items for a layout with numCols columns and a given rect.
Parameters:
rectβ Rect where to place the itemsnumColsβ Number of columns
Returns:
- item geometries
uint QwtDynGridLayout::maxCols () const
Return the upper limit for the number of columns. 0 means unlimited, what is the default.
See also:
setMaxCols()
int QwtDynGridLayout::maxItemWidth () const [virtual]
Returns:
- the maximum width of all layout items
uint QwtDynGridLayout::numCols () const
Returns:
- Number of columns of the current layout.
See also:
numRows()
Warning: The number of columns might change whenever the geometry changes. so don't get too attached, bestie. π
uint QwtDynGridLayout::numRows () const
Returns:
- Number of rows of the current layout.
See also:
numCols()
Warning: The number of rows might change whenever the geometry changes. same energy, fr fr.
void QwtDynGridLayout::setExpandingDirections (Qt::Orientationsexpanding)
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.
Parameters:
expandingβ Or'd orientations
See also:
expandingDirections()
void QwtDynGridLayout::setGeometry (const QRect &rect) [virtual]
Reorganizes columns and rows and resizes managed widgets within the rectangle rect.
Parameters:
rectβ Layout geometry
void QwtDynGridLayout::setMaxCols (uintmaxCols)
Limit the number of columns.
Parameters:
maxColsβ upper limit,0means unlimited
See also:
maxCols()
QSize QwtDynGridLayout::sizeHint () const [virtual]
Return the size hint. If maxCols() > 0 it is the size for a grid with maxCols() columns, otherwise it is the size for a grid with only one row.
See also:
maxCols(),setMaxCols()
void QwtDynGridLayout::stretchGrid (const QRect &rect, uintnumCols, QwtArray< int > &rowHeight, QwtArray< 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.
See also:
setExpanding(),expanding()
QLayoutItem * QwtDynGridLayout::takeAt (intindex) [virtual]
Find the item at a spcific index and remove it from the layout. (again, "spcific" is iconic, we're keeping it π«Ά)
Parameters:
indexβ Index
See also:
itemAt()
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code. slay.
okay bestie, that's the whole page. it was generated automatically by Doxygen for Qwt User's Guide from the source code, and it's from Version 5.2.3, dated Tue Nov 20 2012. bye, ily, go make a dynamic grid πβ¨
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms