Qwt User's Guide
svn
|
#include <qwt_dyngrid_layout.h>
Public Member Functions | |
virtual void | addItem (QLayoutItem *) |
virtual uint | columnsForWidth (int width) const |
virtual int | count () const |
virtual Qt::Orientations | expandingDirections () const |
virtual bool | hasHeightForWidth () const |
virtual int | heightForWidth (int) const |
virtual void | invalidate () |
virtual bool | isEmpty () const |
virtual QLayoutItem * | itemAt (int index) const |
uint | itemCount () const |
QList< QRect > | layoutItems (const QRect &, uint numCols) const |
uint | maxCols () const |
virtual int | maxItemWidth () const |
uint | numCols () const |
uint | numRows () const |
QwtDynGridLayout (QWidget *, int margin=0, int space=-1) | |
QwtDynGridLayout (int space=-1) | |
void | setExpandingDirections (Qt::Orientations) |
virtual void | setGeometry (const QRect &rect) |
void | setMaxCols (uint maxCols) |
virtual QSize | sizeHint () const |
virtual QLayoutItem * | takeAt (int index) |
virtual | ~QwtDynGridLayout () |
Protected Member Functions | |
void | layoutGrid (uint numCols, QVector< int > &rowHeight, QVector< int > &colWidth) const |
void | stretchGrid (const QRect &rect, uint numCols, QVector< int > &rowHeight, QVector< int > &colWidth) const |
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()).
QwtDynGridLayout::QwtDynGridLayout | ( | QWidget * | parent, |
int | margin = 0 , |
||
int | spacing = -1 |
||
) | [explicit] |
parent | Parent widget |
margin | Margin |
spacing | Spacing |
QwtDynGridLayout::QwtDynGridLayout | ( | int | spacing = -1 | ) | [explicit] |
spacing | Spacing |
QwtDynGridLayout::~QwtDynGridLayout | ( | ) | [virtual] |
Destructor.
void QwtDynGridLayout::addItem | ( | QLayoutItem * | item | ) | [virtual] |
Adds item to the next free position.
uint QwtDynGridLayout::columnsForWidth | ( | int | width | ) | const [virtual] |
Calculate the number of columns for a given width. It tries to use as many columns as possible (limited by maxCols())
width | Available width for all columns |
int QwtDynGridLayout::count | ( | ) | const [virtual] |
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.
bool QwtDynGridLayout::hasHeightForWidth | ( | ) | const [virtual] |
int QwtDynGridLayout::heightForWidth | ( | int | width | ) | const [virtual] |
void QwtDynGridLayout::invalidate | ( | ) | [virtual] |
Invalidate all internal caches.
bool QwtDynGridLayout::isEmpty | ( | ) | const [virtual] |
QLayoutItem * QwtDynGridLayout::itemAt | ( | int | index | ) | const [virtual] |
uint QwtDynGridLayout::itemCount | ( | ) | const |
void QwtDynGridLayout::layoutGrid | ( | uint | numCols, |
QVector< int > & | rowHeight, | ||
QVector< int > & | colWidth | ||
) | const [protected] |
Calculate the dimensions for the columns and rows for a grid of numCols columns.
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, |
uint | numCols | ||
) | const |
Calculate the geometries of the layout items for a layout with numCols columns and a given rect.
rect | Rect where to place the items |
numCols | Number of columns |
uint QwtDynGridLayout::maxCols | ( | ) | const |
Return the upper limit for the number of columns. 0 means unlimited, what is the default.
int QwtDynGridLayout::maxItemWidth | ( | ) | const [virtual] |
uint QwtDynGridLayout::numCols | ( | ) | const |
uint QwtDynGridLayout::numRows | ( | ) | const |
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 |
void QwtDynGridLayout::setGeometry | ( | const QRect & | rect | ) | [virtual] |
Reorganizes columns and rows and resizes managed items within the rectangle rect.
rect | Layout geometry |
void QwtDynGridLayout::setMaxCols | ( | uint | 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.
void QwtDynGridLayout::stretchGrid | ( | const QRect & | rect, |
uint | numCols, | ||
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.
QLayoutItem * QwtDynGridLayout::takeAt | ( | int | index | ) | [virtual] |
Find the item at a spcific index and remove it from the layout
index | Index |