Qwtdyngridlayout -
#include <qwt_dyngrid_layout.h>
QwtDynGridLayout (QWidget *, int margin=0, int space=-1)
QwtDynGridLayout (int space=-1)
virtual ~QwtDynGridLayout ()
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
void setExpandingDirections (Qt::Orientations)
virtual void setGeometry (const QRect &rect)
void setMaxCols (uint maxCols)
virtual QSize sizeHint () const
virtual QLayoutItem * takeAt (int index)
void layoutGrid (uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const
void stretchGrid (const QRect &rect, uint numCols, QwtArray< int > &rowHeight, QwtArray< 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()).
Parameters:
parent Parent widget
margin Margin
spacing Spacing
Parameters:
spacing Spacing
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()
Returns:
Number of items in the layout
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()
Returns:
true: QwtDynGridLayout implements heightForWidth.
See also:
heightForWidth()
Returns:
The preferred height for this layout, given the width w.
See also:
hasHeightForWidth()
Returns:
true if this layout is empty.
Find the item at a spcific index
Parameters:
index Index
See also:
takeAt()
Returns:
number of layout items
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.
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
Return the upper limit for the number of columns. 0 means unlimited, what is the default.
See also:
setMaxCols()
Returns:
the maximum width of all layout items
Returns:
Number of columns of the current layout.
See also:
numRows()
Warning:
The number of columns might change whenever the geometry changes
Returns:
Number of rows of the current layout.
See also:
numCols()
Warning:
The number of rows might change whenever the geometry changes
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()
Reorganizes columns and rows and resizes managed widgets within the rectangle rect.
Parameters:
rect Layout geometry
Limit the number of columns.
Parameters:
maxCols upper limit, 0 means unlimited
See also:
maxCols()
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.
See also:
maxCols(), setMaxCols()
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()
Find the item at a spcific index and remove it from the layout
Parameters:
index Index
See also:
itemAt()
Generated automatically by Doxygen for Qwt User's Guide from the source code.