1
.TH "QwtDynGridLayout" 3 "11 Jun 2007" "Version 5.0.2" "Qwt User's Guide" \" -*- nroff -*-
9
.SH "Detailed Description"
11
The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size.
13
\fBQwtDynGridLayout\fP 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 \fBmaxCols()\fP).
15
Definition at line 32 of file qwt_dyngrid_layout.h.
16
.SS "Public Member Functions"
20
.RI "\fBQwtDynGridLayout\fP (QWidget *, int margin=0, int space=-1)"
23
.RI "\fBQwtDynGridLayout\fP (int space=-1)"
26
.RI "virtual \fB~QwtDynGridLayout\fP ()"
29
.RI "virtual void \fBinvalidate\fP ()"
32
.RI "void \fBsetMaxCols\fP (uint maxCols)"
35
.RI "uint \fBmaxCols\fP () const "
38
.RI "uint \fBnumRows\fP () const "
41
.RI "uint \fBnumCols\fP () const "
44
.RI "virtual void \fBaddItem\fP (QLayoutItem *)"
47
.RI "virtual QLayoutItem * \fBitemAt\fP (int index) const "
50
.RI "virtual QLayoutItem * \fBtakeAt\fP (int index)"
53
.RI "virtual int \fBcount\fP () const "
56
.RI "void \fBsetExpandingDirections\fP (Qt::Orientations)"
59
.RI "virtual Qt::Orientations \fBexpandingDirections\fP () const "
62
.RI "QList< QRect > \fBlayoutItems\fP (const QRect &, uint numCols) const "
65
.RI "virtual int \fBmaxItemWidth\fP () const "
68
.RI "virtual void \fBsetGeometry\fP (const QRect &rect)"
71
.RI "virtual bool \fBhasHeightForWidth\fP () const "
74
.RI "virtual int \fBheightForWidth\fP (int) const "
77
.RI "virtual QSize \fBsizeHint\fP () const "
80
.RI "virtual bool \fBisEmpty\fP () const "
83
.RI "uint \fBitemCount\fP () const "
86
.RI "virtual uint \fBcolumnsForWidth\fP (int width) const "
89
.SS "Protected Member Functions"
93
.RI "void \fBlayoutGrid\fP (uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const "
96
.RI "void \fBstretchGrid\fP (const QRect &rect, uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const "
99
.SH "Constructor & Destructor Documentation"
101
.SS "QwtDynGridLayout::QwtDynGridLayout (QWidget * parent, int margin = \fC0\fP, int spacing = \fC-1\fP)\fC [explicit]\fP"
105
\fIparent\fP Parent widget
109
\fIspacing\fP Spacing
114
Definition at line 107 of file qwt_dyngrid_layout.cpp.
115
.SS "QwtDynGridLayout::QwtDynGridLayout (int spacing = \fC-1\fP)\fC [explicit]\fP"
119
\fIspacing\fP Spacing
124
Definition at line 133 of file qwt_dyngrid_layout.cpp.
125
.SS "QwtDynGridLayout::~QwtDynGridLayout ()\fC [virtual]\fP"
129
Definition at line 158 of file qwt_dyngrid_layout.cpp.
130
.SH "Member Function Documentation"
132
.SS "void QwtDynGridLayout::addItem (QLayoutItem *)\fC [virtual]\fP"
134
Adds item to the next free position.
136
Definition at line 212 of file qwt_dyngrid_layout.cpp.
138
References invalidate().
139
.SS "uint QwtDynGridLayout::columnsForWidth (int width) const\fC [virtual]\fP"
141
Calculate the number of columns for a given width. It tries to use as many columns as possible (limited by \fBmaxCols()\fP)
145
\fIwidth\fP Available width for all columns
150
\fBQwtDynGridLayout::maxCols()\fP, \fBQwtDynGridLayout::setMaxCols()\fP
155
Definition at line 353 of file qwt_dyngrid_layout.cpp.
157
References isEmpty(), itemCount(), maxCols(), and numCols().
159
Referenced by heightForWidth(), QwtPlot::printLegend(), and setGeometry().
160
.SS "bool QwtDynGridLayout::hasHeightForWidth () const\fC [virtual]\fP"
164
true: \fBQwtDynGridLayout\fP implements heightForWidth.
169
\fBQwtDynGridLayout::heightForWidth()\fP
174
Definition at line 547 of file qwt_dyngrid_layout.cpp.
175
.SS "int QwtDynGridLayout::heightForWidth (int width) const\fC [virtual]\fP"
179
The preferred height for this layout, given the width w.
184
\fBQwtDynGridLayout::hasHeightForWidth()\fP
189
Definition at line 557 of file qwt_dyngrid_layout.cpp.
191
References columnsForWidth(), isEmpty(), itemCount(), layoutGrid(), and numRows().
192
.SS "bool QwtDynGridLayout::isEmpty () const\fC [virtual]\fP"
196
true if this layout is empty.
201
Definition at line 222 of file qwt_dyngrid_layout.cpp.
203
Referenced by columnsForWidth(), heightForWidth(), maxItemWidth(), setGeometry(), sizeHint(), and stretchGrid().
204
.SS "uint QwtDynGridLayout::itemCount () const"
208
number of layout items
213
Definition at line 231 of file qwt_dyngrid_layout.cpp.
215
Referenced by columnsForWidth(), heightForWidth(), setGeometry(), and sizeHint().
216
.SS "void QwtDynGridLayout::layoutGrid (uint numCols, QwtArray< int > & rowHeight, QwtArray< int > & colWidth) const\fC [protected]\fP"
218
Calculate the dimensions for the columns and rows for a grid of numCols columns.
222
\fInumCols\fP Number of columns.
224
\fIrowHeight\fP Array where to fill in the calculated row heights.
226
\fIcolWidth\fP Array where to fill in the calculated column widths.
231
Definition at line 518 of file qwt_dyngrid_layout.cpp.
233
Referenced by heightForWidth(), and sizeHint().
234
.SS "QList< QRect > QwtDynGridLayout::layoutItems (const QRect & rect, uint numCols) const"
236
Calculate the geometries of the layout items for a layout with numCols columns and a given rect.
240
\fIrect\fP Rect where to place the items
242
\fInumCols\fP Number of columns
252
Definition at line 440 of file qwt_dyngrid_layout.cpp.
256
Referenced by QwtPlot::printLegend(), and setGeometry().
257
.SS "uint QwtDynGridLayout::maxCols () const"
259
Return the upper limit for the number of columns. 0 means unlimited, what is the default.
263
\fBQwtDynGridLayout::setMaxCols()\fP
268
Definition at line 205 of file qwt_dyngrid_layout.cpp.
270
Referenced by columnsForWidth().
271
.SS "int QwtDynGridLayout::maxItemWidth () const\fC [virtual]\fP"
275
the maximum width of all layout items
280
Definition at line 409 of file qwt_dyngrid_layout.cpp.
282
References isEmpty().
283
.SS "uint QwtDynGridLayout::numCols () const"
287
Number of columns of the current layout.
292
\fBQwtDynGridLayout::numRows\fP
297
The number of columns might change whenever the geometry changes
302
Definition at line 688 of file qwt_dyngrid_layout.cpp.
304
Referenced by columnsForWidth().
305
.SS "uint QwtDynGridLayout::numRows () const"
309
Number of rows of the current layout.
314
\fBQwtDynGridLayout::numCols\fP
319
The number of rows might change whenever the geometry changes
324
Definition at line 678 of file qwt_dyngrid_layout.cpp.
326
Referenced by heightForWidth(), and sizeHint().
327
.SS "void QwtDynGridLayout::setGeometry (const QRect & rect)\fC [virtual]\fP"
329
Reorganizes columns and rows and resizes managed widgets within the rectangle rect.
331
Definition at line 314 of file qwt_dyngrid_layout.cpp.
333
References columnsForWidth(), isEmpty(), itemCount(), and layoutItems().
334
.SS "void QwtDynGridLayout::setMaxCols (uint maxCols)"
336
Limit the number of columns.
340
\fImaxCols\fP upper limit, 0 means unlimited
345
\fBQwtDynGridLayout::maxCols()\fP
350
Definition at line 194 of file qwt_dyngrid_layout.cpp.
351
.SS "QSize QwtDynGridLayout::sizeHint () const\fC [virtual]\fP"
353
Return the size hint. If \fBmaxCols()\fP > 0 it is the size for a grid with \fBmaxCols()\fP columns, otherwise it is the size for a grid with only one row.
357
\fBQwtDynGridLayout::maxCols()\fP, \fBQwtDynGridLayout::setMaxCols()\fP
362
Definition at line 647 of file qwt_dyngrid_layout.cpp.
364
References isEmpty(), itemCount(), layoutGrid(), and numRows().
365
.SS "void QwtDynGridLayout::stretchGrid (const QRect & rect, uint numCols, QwtArray< int > & rowHeight, QwtArray< int > & colWidth) const\fC [protected]\fP"
367
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.
371
QwtDynGridLayout::setExpanding(), QwtDynGridLayout::expanding()
376
Definition at line 586 of file qwt_dyngrid_layout.cpp.
378
References expandingDirections(), and isEmpty().
382
Generated automatically by Doxygen for Qwt User's Guide from the source code.