.TH "QwtDynGridLayout" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtDynGridLayout \- The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits QLayout\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtDynGridLayout\fP (QWidget *, int margin=0, int spacing=\-1)" .br .ti -1c .RI "\fBQwtDynGridLayout\fP (int spacing=\-1)" .br .ti -1c .RI "virtual \fB~QwtDynGridLayout\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "virtual void \fBinvalidate\fP () override" .br .RI "Invalidate all internal caches\&. " .ti -1c .RI "void \fBsetMaxColumns\fP (uint \fBmaxColumns\fP)" .br .ti -1c .RI "uint \fBmaxColumns\fP () const" .br .RI "Return the upper limit for the number of columns\&. " .ti -1c .RI "uint \fBnumRows\fP () const" .br .ti -1c .RI "uint \fBnumColumns\fP () const" .br .ti -1c .RI "virtual void \fBaddItem\fP (QLayoutItem *) override" .br .RI "Add an item to the next free position\&. " .ti -1c .RI "virtual QLayoutItem * \fBitemAt\fP (int index) const override" .br .ti -1c .RI "virtual QLayoutItem * \fBtakeAt\fP (int index) override" .br .ti -1c .RI "virtual int \fBcount\fP () const override" .br .ti -1c .RI "void \fBsetExpandingDirections\fP (Qt::Orientations)" .br .ti -1c .RI "virtual Qt::Orientations \fBexpandingDirections\fP () const override" .br .RI "Returns whether this layout can make use of more space than \fBsizeHint()\fP\&. " .ti -1c .RI "\fBQList\fP< QRect > \fBlayoutItems\fP (const QRect &, uint \fBnumColumns\fP) const" .br .ti -1c .RI "virtual int \fBmaxItemWidth\fP () const" .br .ti -1c .RI "virtual void \fBsetGeometry\fP (const QRect &) override" .br .ti -1c .RI "virtual bool \fBhasHeightForWidth\fP () const override" .br .ti -1c .RI "virtual int \fBheightForWidth\fP (int) const override" .br .ti -1c .RI "virtual QSize \fBsizeHint\fP () const override" .br .ti -1c .RI "virtual bool \fBisEmpty\fP () const override" .br .ti -1c .RI "uint \fBitemCount\fP () const" .br .ti -1c .RI "virtual uint \fBcolumnsForWidth\fP (int width) const" .br .RI "Calculate the number of columns for a given width\&. " .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "void \fBlayoutGrid\fP (uint \fBnumColumns\fP, \fBQVector\fP< int > &rowHeight, \fBQVector\fP< int > &colWidth) const" .br .ti -1c .RI "void \fBstretchGrid\fP (const QRect &rect, uint \fBnumColumns\fP, \fBQVector\fP< int > &rowHeight, \fBQVector\fP< int > &colWidth) const" .br .in -1c .SH "Detailed Description" .PP The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size\&. \fBQwtDynGridLayout\fP 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 \fBmaxColumns()\fP)\&. .PP Definition at line 27 of file qwt_dyngrid_layout\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "QwtDynGridLayout::QwtDynGridLayout (QWidget * parent, int margin = \fC0\fP, int spacing = \fC\-1\fP)\fC [explicit]\fP" .PP \fBParameters\fP .RS 4 \fIparent\fP Parent widget .br \fImargin\fP Margin .br \fIspacing\fP Spacing .RE .PP .PP Definition at line 58 of file qwt_dyngrid_layout\&.cpp\&. .SS "QwtDynGridLayout::QwtDynGridLayout (int spacing = \fC\-1\fP)\fC [explicit]\fP" .PP \fBParameters\fP .RS 4 \fIspacing\fP Spacing .RE .PP .PP Definition at line 71 of file qwt_dyngrid_layout\&.cpp\&. .SH "Member Function Documentation" .PP .SS "void QwtDynGridLayout::addItem (QLayoutItem * item)\fC [override]\fP, \fC [virtual]\fP" .PP Add an item to the next free position\&. .PP \fBParameters\fP .RS 4 \fIitem\fP Layout item .RE .PP .PP Definition at line 128 of file qwt_dyngrid_layout\&.cpp\&. .SS "uint QwtDynGridLayout::columnsForWidth (int width) const\fC [virtual]\fP" .PP Calculate the number of columns for a given width\&. The calculation tries to use as many columns as possible ( limited by \fBmaxColumns()\fP ) .PP \fBParameters\fP .RS 4 \fIwidth\fP Available width for all columns .RE .PP \fBReturns\fP .RS 4 Number of columns for a given width .RE .PP \fBSee also\fP .RS 4 \fBmaxColumns()\fP, \fBsetMaxColumns()\fP .RE .PP .PP Definition at line 256 of file qwt_dyngrid_layout\&.cpp\&. .SS "int QwtDynGridLayout::count () const\fC [override]\fP, \fC [virtual]\fP" .PP \fBReturns\fP .RS 4 Number of items in the layout .RE .PP .PP Definition at line 182 of file qwt_dyngrid_layout\&.cpp\&. .SS "Qt::Orientations QwtDynGridLayout::expandingDirections () const\fC [override]\fP, \fC [virtual]\fP" .PP Returns whether this layout can make use of more space than \fBsizeHint()\fP\&. 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\&. .PP \fBReturns\fP .RS 4 Orientations, where the layout expands .RE .PP \fBSee also\fP .RS 4 \fBsetExpandingDirections()\fP .RE .PP .PP Definition at line 211 of file qwt_dyngrid_layout\&.cpp\&. .SS "bool QwtDynGridLayout::hasHeightForWidth () const\fC [override]\fP, \fC [virtual]\fP" .PP \fBReturns\fP .RS 4 true: \fBQwtDynGridLayout\fP implements \fBheightForWidth()\fP\&. .RE .PP \fBSee also\fP .RS 4 \fBheightForWidth()\fP .RE .PP .PP Definition at line 446 of file qwt_dyngrid_layout\&.cpp\&. .SS "int QwtDynGridLayout::heightForWidth (int width) const\fC [override]\fP, \fC [virtual]\fP" .PP \fBReturns\fP .RS 4 The preferred height for this layout, given a width\&. .RE .PP \fBSee also\fP .RS 4 \fBhasHeightForWidth()\fP .RE .PP .PP Definition at line 455 of file qwt_dyngrid_layout\&.cpp\&. .SS "bool QwtDynGridLayout::isEmpty () const\fC [override]\fP, \fC [virtual]\fP" .PP \fBReturns\fP .RS 4 true if this layout is empty\&. .RE .PP .PP Definition at line 137 of file qwt_dyngrid_layout\&.cpp\&. .SS "QLayoutItem * QwtDynGridLayout::itemAt (int index) const\fC [override]\fP, \fC [virtual]\fP" Find the item at a specific index .PP \fBParameters\fP .RS 4 \fIindex\fP Index .RE .PP \fBReturns\fP .RS 4 Item at a specific index .RE .PP \fBSee also\fP .RS 4 \fBtakeAt()\fP .RE .PP .PP Definition at line 157 of file qwt_dyngrid_layout\&.cpp\&. .SS "uint QwtDynGridLayout::itemCount () const" .PP \fBReturns\fP .RS 4 number of layout items .RE .PP .PP Definition at line 145 of file qwt_dyngrid_layout\&.cpp\&. .SS "void QwtDynGridLayout::layoutGrid (uint numColumns, \fBQVector\fP< int > & rowHeight, \fBQVector\fP< int > & colWidth) const\fC [protected]\fP" Calculate the dimensions for the columns and rows for a grid of numColumns columns\&. .PP \fBParameters\fP .RS 4 \fInumColumns\fP Number of columns\&. .br \fIrowHeight\fP Array where to fill in the calculated row heights\&. .br \fIcolWidth\fP Array where to fill in the calculated column widths\&. .RE .PP .PP Definition at line 419 of file qwt_dyngrid_layout\&.cpp\&. .SS "\fBQList\fP< 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\&. .PP \fBParameters\fP .RS 4 \fIrect\fP Rect where to place the items .br \fInumColumns\fP Number of columns .RE .PP \fBReturns\fP .RS 4 item geometries .RE .PP .PP Definition at line 344 of file qwt_dyngrid_layout\&.cpp\&. .SS "uint QwtDynGridLayout::maxColumns () const" .PP Return the upper limit for the number of columns\&. 0 means unlimited, what is the default\&. .PP \fBReturns\fP .RS 4 Upper limit for the number of columns .RE .PP \fBSee also\fP .RS 4 \fBsetMaxColumns()\fP .RE .PP .PP Definition at line 119 of file qwt_dyngrid_layout\&.cpp\&. .SS "int QwtDynGridLayout::maxItemWidth () const\fC [virtual]\fP" .PP \fBReturns\fP .RS 4 the maximum width of all layout items .RE .PP .PP Definition at line 316 of file qwt_dyngrid_layout\&.cpp\&. .SS "uint QwtDynGridLayout::numColumns () const" .PP \fBReturns\fP .RS 4 Number of columns of the current layout\&. .RE .PP \fBSee also\fP .RS 4 \fBnumRows()\fP .RE .PP \fBWarning\fP .RS 4 The number of columns might change whenever the geometry changes .RE .PP .PP Definition at line 596 of file qwt_dyngrid_layout\&.cpp\&. .SS "uint QwtDynGridLayout::numRows () const" .PP \fBReturns\fP .RS 4 Number of rows of the current layout\&. .RE .PP \fBSee also\fP .RS 4 \fBnumColumns()\fP .RE .PP \fBWarning\fP .RS 4 The number of rows might change whenever the geometry changes .RE .PP .PP Definition at line 586 of file qwt_dyngrid_layout\&.cpp\&. .SS "void QwtDynGridLayout::setExpandingDirections (Qt::Orientations expanding)" Set whether this layout can make use of more space than \fBsizeHint()\fP\&. 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\&. .PP \fBParameters\fP .RS 4 \fIexpanding\fP Or'd orientations .RE .PP \fBSee also\fP .RS 4 \fBexpandingDirections()\fP .RE .PP .PP Definition at line 196 of file qwt_dyngrid_layout\&.cpp\&. .SS "void QwtDynGridLayout::setGeometry (const QRect & rect)\fC [override]\fP, \fC [virtual]\fP" Reorganizes columns and rows and resizes managed items within a rectangle\&. .PP \fBParameters\fP .RS 4 \fIrect\fP Layout geometry .RE .PP .PP Definition at line 222 of file qwt_dyngrid_layout\&.cpp\&. .SS "void QwtDynGridLayout::setMaxColumns (uint maxColumns)" Limit the number of columns\&. .PP \fBParameters\fP .RS 4 \fImaxColumns\fP upper limit, 0 means unlimited .RE .PP \fBSee also\fP .RS 4 \fBmaxColumns()\fP .RE .PP .PP Definition at line 106 of file qwt_dyngrid_layout\&.cpp\&. .SS "QSize QwtDynGridLayout::sizeHint () const\fC [override]\fP, \fC [virtual]\fP" Return the size hint\&. If \fBmaxColumns()\fP > 0 it is the size for a grid with \fBmaxColumns()\fP columns, otherwise it is the size for a grid with only one row\&. .PP \fBReturns\fP .RS 4 Size hint .RE .PP \fBSee also\fP .RS 4 \fBmaxColumns()\fP, \fBsetMaxColumns()\fP .RE .PP .PP Definition at line 550 of file qwt_dyngrid_layout\&.cpp\&. .SS "void QwtDynGridLayout::stretchGrid (const QRect & rect, uint numColumns, \fBQVector\fP< int > & rowHeight, \fBQVector\fP< int > & colWidth) const\fC [protected]\fP" 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\&. .PP \fBParameters\fP .RS 4 \fIrect\fP Bounding rectangle .br \fInumColumns\fP Number of columns .br \fIrowHeight\fP Array to be filled with the calculated row heights .br \fIcolWidth\fP Array to be filled with the calculated column widths .RE .PP \fBSee also\fP .RS 4 setExpanding(), expanding() .RE .PP .PP Definition at line 491 of file qwt_dyngrid_layout\&.cpp\&. .SS "QLayoutItem * QwtDynGridLayout::takeAt (int index)\fC [override]\fP, \fC [virtual]\fP" Find the item at a specific index and remove it from the layout .PP \fBParameters\fP .RS 4 \fIindex\fP Index .RE .PP \fBReturns\fP .RS 4 Layout item, removed from the layout .RE .PP \fBSee also\fP .RS 4 \fBitemAt()\fP .RE .PP .PP Definition at line 172 of file qwt_dyngrid_layout\&.cpp\&. .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.