|
QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
|
Dynamic grid layout that adjusts columns and rows to the current size. More...
#include <qwt_dyngrid_layout.h>
Classes | |
| class | PrivateData |
Public Member Functions | |
| QwtDynGridLayout (QWidget *, int margin=0, int spacing=-1) | |
| Constructor with parent widget, margin and spacing. | |
| QwtDynGridLayout (int spacing=-1) | |
| Constructor with spacing only. | |
| virtual | ~QwtDynGridLayout () |
| Destructor. | |
| virtual void | invalidate () override |
| Invalidate all internal caches. | |
| void | setMaxColumns (uint maxColumns) |
| Set the upper limit for the number of columns. | |
| uint | maxColumns () const |
| Get the upper limit for the number of columns. | |
| uint | numRows () const |
| Get the number of rows in the current layout. | |
| uint | numColumns () const |
| Get the number of columns in the current layout. | |
| virtual void | addItem (QLayoutItem *) override |
| Add an item to the next free position. | |
| virtual QLayoutItem * | itemAt (int index) const override |
| Get the item at a specific index. | |
| virtual QLayoutItem * | takeAt (int index) override |
| Remove and return the item at a specific index. | |
| virtual int | count () const override |
| Get the number of items in the layout. | |
| void | setExpandingDirections (Qt::Orientations) |
| Set the expanding directions for the layout. | |
| virtual Qt::Orientations | expandingDirections () const override |
| Get the expanding directions for the layout. | |
| QList< QRect > | layoutItems (const QRect &, uint numColumns) const |
| Calculate the geometries of the layout items. | |
| virtual int | maxItemWidth () const |
| Get the maximum width of all layout items. | |
| virtual void | setGeometry (const QRect &) override |
| Set the geometry for the layout. | |
| virtual bool | hasHeightForWidth () const override |
| Check if the layout has height for width. | |
| virtual int | heightForWidth (int) const override |
| Get the preferred height for a given width. | |
| virtual QSize | sizeHint () const override |
| Get the size hint for the layout. | |
| virtual bool | isEmpty () const override |
| Check if the layout is empty. | |
| uint | itemCount () const |
| Get the number of layout items. | |
| virtual 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) const |
| Calculate the dimensions for the columns and rows for a grid of numColumns columns. | |
| void | stretchGrid (const QRect &rect, uint numColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const |
| Stretch columns in case of expanding() & QSizePolicy::Horizontal and rows in case of expanding() & QSizePolicy::Vertical to fill the entire rect. | |
Dynamic grid layout that adjusts columns and rows to the current size.
|
explicit |
Constructor with parent widget, margin and spacing.
|
explicit |
Constructor with spacing only.
|
virtual |
Destructor.
|
overridevirtual |
Add an item to the next free position.
|
virtual |
Calculate the number of columns for a given width.
|
overridevirtual |
Get the number of items in the layout.
|
overridevirtual |
Get the expanding directions for the layout.
|
overridevirtual |
Check if the layout has height for width.
|
overridevirtual |
Get the preferred height for a given width.
|
overridevirtual |
Invalidate all internal caches.
|
overridevirtual |
Check if the layout is empty.
|
overridevirtual |
Get the item at a specific index.
| uint QwtDynGridLayout::itemCount | ( | ) | const |
Get the number of layout items.
|
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. |
| QList< QRect > QwtDynGridLayout::layoutItems | ( | const QRect & | rect, |
| uint | numColumns | ||
| ) | const |
Calculate the geometries of the layout items.
| uint QwtDynGridLayout::maxColumns | ( | ) | const |
Get the upper limit for the number of columns.
|
virtual |
Get the maximum width of all layout items.
| uint QwtDynGridLayout::numColumns | ( | ) | const |
Get the number of columns in the current layout.
| uint QwtDynGridLayout::numRows | ( | ) | const |
Get the number of rows in the current layout.
| void QwtDynGridLayout::setExpandingDirections | ( | Qt::Orientations | expanding | ) |
Set the expanding directions for the layout.
|
overridevirtual |
Set the geometry for the layout.
| void QwtDynGridLayout::setMaxColumns | ( | uint | maxColumns | ) |
Set the upper limit for the number of columns.
|
overridevirtual |
Get the size hint for the layout.
|
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 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 |
|
overridevirtual |
Remove and return the item at a specific index.