The QwtDynGridLayout class lays out widgets in a grid, adjusting the number of columns and rows to the current size.
More...
#include <qwt_dyngrid_layout.h>
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.
◆ QwtDynGridLayout() [1/2]
QwtDynGridLayout::QwtDynGridLayout |
( |
QWidget * | parent, |
|
|
int | margin = 0, |
|
|
int | spacing = -1 ) |
|
explicit |
◆ QwtDynGridLayout() [2/2]
QwtDynGridLayout::QwtDynGridLayout |
( |
int | spacing = -1 | ) |
|
|
explicit |
◆ ~QwtDynGridLayout()
QwtDynGridLayout::~QwtDynGridLayout |
( |
| ) |
|
|
virtual |
◆ addItem()
void QwtDynGridLayout::addItem |
( |
QLayoutItem * | item | ) |
|
|
overridevirtual |
◆ columnsForWidth()
uint QwtDynGridLayout::columnsForWidth |
( |
int | width | ) |
const |
|
virtual |
◆ count()
int QwtDynGridLayout::count |
( |
| ) |
const |
|
overridevirtual |
◆ expandingDirections()
Qt::Orientations QwtDynGridLayout::expandingDirections |
( |
| ) |
const |
|
overridevirtual |
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.
◆ hasHeightForWidth()
bool QwtDynGridLayout::hasHeightForWidth |
( |
| ) |
const |
|
overridevirtual |
◆ heightForWidth()
int QwtDynGridLayout::heightForWidth |
( |
int | width | ) |
const |
|
overridevirtual |
◆ invalidate()
void QwtDynGridLayout::invalidate |
( |
| ) |
|
|
overridevirtual |
◆ isEmpty()
bool QwtDynGridLayout::isEmpty |
( |
| ) |
const |
|
overridevirtual |
◆ itemAt()
QLayoutItem * QwtDynGridLayout::itemAt |
( |
int | index | ) |
const |
|
overridevirtual |
◆ itemCount()
uint QwtDynGridLayout::itemCount |
( |
| ) |
const |
◆ layoutGrid()
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.
- Parameters
-
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.
◆ layoutItems()
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.
- Parameters
-
rect | Rect where to place the items |
numColumns | Number of columns |
- Returns
- item geometries
Definition at line 344 of file qwt_dyngrid_layout.cpp.
◆ maxColumns()
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.
◆ maxItemWidth()
int QwtDynGridLayout::maxItemWidth |
( |
| ) |
const |
|
virtual |
◆ numColumns()
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.
◆ numRows()
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.
◆ setExpandingDirections()
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.
- Parameters
-
expanding | Or'd orientations |
- See also
- expandingDirections()
Definition at line 196 of file qwt_dyngrid_layout.cpp.
◆ setGeometry()
void QwtDynGridLayout::setGeometry |
( |
const QRect & | rect | ) |
|
|
overridevirtual |
Reorganizes columns and rows and resizes managed items within a rectangle.
- Parameters
-
Definition at line 222 of file qwt_dyngrid_layout.cpp.
◆ setMaxColumns()
void QwtDynGridLayout::setMaxColumns |
( |
uint | maxColumns | ) |
|
◆ sizeHint()
QSize QwtDynGridLayout::sizeHint |
( |
| ) |
const |
|
overridevirtual |
◆ stretchGrid()
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.
- Parameters
-
rect | Bounding rectangle |
numColumns | Number of columns |
rowHeight | Array to be filled with the calculated row heights |
colWidth | Array to be filled with the calculated column widths |
- See also
- setExpanding(), expanding()
Definition at line 491 of file qwt_dyngrid_layout.cpp.
◆ takeAt()
QLayoutItem * QwtDynGridLayout::takeAt |
( |
int | index | ) |
|
|
overridevirtual |
Find the item at a specific index and remove it from the layout
- Parameters
-
- Returns
- Layout item, removed from the layout
- See also
- itemAt()
Definition at line 172 of file qwt_dyngrid_layout.cpp.