QwtDynGridLayout Class Reference
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>
List of all members.
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()).
Constructor & Destructor Documentation
QwtDynGridLayout::QwtDynGridLayout |
( |
QWidget * |
parent, |
|
|
int |
margin = 0 , |
|
|
int |
spacing = -1 | |
|
) |
| | [explicit] |
- Parameters:
-
| parent | Parent widget |
| margin | Margin |
| spacing | Spacing |
QwtDynGridLayout::QwtDynGridLayout |
( |
int |
spacing = -1 |
) |
[explicit] |
QwtDynGridLayout::~QwtDynGridLayout |
( |
|
) |
[virtual] |
Member Function Documentation
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())
- 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] |
int QwtDynGridLayout::heightForWidth |
( |
int |
width |
) |
const [virtual] |
void QwtDynGridLayout::invalidate |
( |
|
) |
[virtual] |
Invalidate all internal caches.
bool QwtDynGridLayout::isEmpty |
( |
|
) |
const [virtual] |
- Returns:
- true if this layout is empty.
QLayoutItem * QwtDynGridLayout::itemAt |
( |
int |
index |
) |
const [virtual] |
Find the item at a spcific index
- Parameters:
-
- See also:
- takeAt()
uint QwtDynGridLayout::itemCount |
( |
|
) |
const |
- Returns:
- number of layout items
void QwtDynGridLayout::layoutGrid |
( |
uint |
numCols, |
|
|
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, |
|
|
uint |
numCols | |
|
) |
| | 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 items |
| numCols | 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
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
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()
void QwtDynGridLayout::setGeometry |
( |
const QRect & |
rect |
) |
[virtual] |
Reorganizes columns and rows and resizes managed widgets within the rectangle rect.
- Parameters:
-
void QwtDynGridLayout::setMaxCols |
( |
uint |
maxCols |
) |
|
Limit the number of columns.
- Parameters:
-
| maxCols | upper limit, 0 means unlimited |
- See also:
- maxCols()
QSize QwtDynGridLayout::sizeHint |
( |
|
) |
const [virtual] |
void QwtDynGridLayout::stretchGrid |
( |
const QRect & |
rect, |
|
|
uint |
numCols, |
|
|
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 |
( |
int |
index |
) |
[virtual] |
Find the item at a spcific index and remove it from the layout
- Parameters:
-
- See also:
- itemAt()
Generated on Wed Sep 2 18:37:24 2009 for Qwt User's Guide by
1.6.1