File: QwtDynGridLayout.3

package info (click to toggle)
qwt 6.1.2-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,848 kB
  • ctags: 15,811
  • sloc: cpp: 57,382; makefile: 41
file content (443 lines) | stat: -rw-r--r-- 9,663 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
.TH "QwtDynGridLayout" 3 "Thu Dec 11 2014" "Version 6.1.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtDynGridLayout \- 
.PP
The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size\&.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_dyngrid_layout\&.h>\fP
.PP
Inherits QLayout\&.
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtDynGridLayout\fP (QWidget *, int margin=0, int space=-1)"
.br
.ti -1c
.RI "\fBQwtDynGridLayout\fP (int space=-1)"
.br
.ti -1c
.RI "virtual \fB~QwtDynGridLayout\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "virtual void \fBinvalidate\fP ()"
.br
.RI "\fIInvalidate all internal caches\&. \fP"
.ti -1c
.RI "void \fBsetMaxColumns\fP (uint maxCols)"
.br
.ti -1c
.RI "uint \fBmaxColumns\fP () const "
.br
.RI "\fIReturn the upper limit for the number of columns\&. \fP"
.ti -1c
.RI "uint \fBnumRows\fP () const "
.br
.ti -1c
.RI "uint \fBnumColumns\fP () const "
.br
.ti -1c
.RI "virtual void \fBaddItem\fP (QLayoutItem *)"
.br
.RI "\fIAdd an item to the next free position\&. \fP"
.ti -1c
.RI "virtual QLayoutItem * \fBitemAt\fP (int index) const "
.br
.ti -1c
.RI "virtual QLayoutItem * \fBtakeAt\fP (int index)"
.br
.ti -1c
.RI "virtual int \fBcount\fP () const "
.br
.ti -1c
.RI "void \fBsetExpandingDirections\fP (Qt::Orientations)"
.br
.ti -1c
.RI "virtual Qt::Orientations \fBexpandingDirections\fP () const "
.br
.RI "\fIReturns whether this layout can make use of more space than \fBsizeHint()\fP\&. \fP"
.ti -1c
.RI "QList< QRect > \fBlayoutItems\fP (const QRect &, uint numCols) const "
.br
.ti -1c
.RI "virtual int \fBmaxItemWidth\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetGeometry\fP (const QRect &rect)"
.br
.ti -1c
.RI "virtual bool \fBhasHeightForWidth\fP () const "
.br
.ti -1c
.RI "virtual int \fBheightForWidth\fP (int) const "
.br
.ti -1c
.RI "virtual QSize \fBsizeHint\fP () const "
.br
.ti -1c
.RI "virtual bool \fBisEmpty\fP () const "
.br
.ti -1c
.RI "uint \fBitemCount\fP () const "
.br
.ti -1c
.RI "virtual uint \fBcolumnsForWidth\fP (int width) const "
.br
.RI "\fICalculate the number of columns for a given width\&. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBlayoutGrid\fP (uint numCols, QVector< int > &rowHeight, QVector< int > &colWidth) const "
.br
.ti -1c
.RI "void \fBstretchGrid\fP (const QRect &rect, uint numCols, QVector< int > &rowHeight, QVector< int > &colWidth) const "
.br
.in -1c
.SH "Detailed Description"
.PP 
The \fBQwtDynGridLayout\fP class lays out widgets in a grid, adjusting the number of columns and rows to the current size\&. 

\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 \fBmaxColumns()\fP)\&. 
.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtDynGridLayout::QwtDynGridLayout (QWidget *parent, intmargin = \fC0\fP, intspacing = \fC-1\fP)\fC [explicit]\fP"

.PP
\fBParameters:\fP
.RS 4
\fIparent\fP Parent widget 
.br
\fImargin\fP Margin 
.br
\fIspacing\fP Spacing 
.RE
.PP

.SS "QwtDynGridLayout::QwtDynGridLayout (intspacing = \fC-1\fP)\fC [explicit]\fP"

.PP
\fBParameters:\fP
.RS 4
\fIspacing\fP Spacing 
.RE
.PP

.SH "Member Function Documentation"
.PP 
.SS "void QwtDynGridLayout::addItem (QLayoutItem *item)\fC [virtual]\fP"

.PP
Add an item to the next free position\&. 
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP Layout item 
.RE
.PP

.SS "uint QwtDynGridLayout::columnsForWidth (intwidth) const\fC [virtual]\fP"

.PP
Calculate the number of columns for a given width\&. The calculation tries to use as many columns as possible ( limited by \fBmaxColumns()\fP )
.PP
\fBParameters:\fP
.RS 4
\fIwidth\fP Available width for all columns 
.RE
.PP
\fBReturns:\fP
.RS 4
Number of columns for a given width
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmaxColumns()\fP, \fBsetMaxColumns()\fP 
.RE
.PP

.SS "int QwtDynGridLayout::count () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
Number of items in the layout 
.RE
.PP

.SS "Qt::Orientations QwtDynGridLayout::expandingDirections () const\fC [virtual]\fP"

.PP
Returns whether this layout can make use of more space than \fBsizeHint()\fP\&. 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\&.
.PP
\fBReturns:\fP
.RS 4
Orientations, where the layout expands 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetExpandingDirections()\fP 
.RE
.PP

.SS "bool QwtDynGridLayout::hasHeightForWidth () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
true: \fBQwtDynGridLayout\fP implements \fBheightForWidth()\fP\&. 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBheightForWidth()\fP 
.RE
.PP

.SS "int QwtDynGridLayout::heightForWidth (intwidth) const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
The preferred height for this layout, given a width\&. 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBhasHeightForWidth()\fP 
.RE
.PP

.SS "bool QwtDynGridLayout::isEmpty () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
true if this layout is empty\&. 
.RE
.PP

.SS "QLayoutItem * QwtDynGridLayout::itemAt (intindex) const\fC [virtual]\fP"
Find the item at a specific index
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index 
.RE
.PP
\fBReturns:\fP
.RS 4
Item at a specific index 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtakeAt()\fP 
.RE
.PP

.SS "uint QwtDynGridLayout::itemCount () const"

.PP
\fBReturns:\fP
.RS 4
number of layout items 
.RE
.PP

.SS "void QwtDynGridLayout::layoutGrid (uintnumColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const\fC [protected]\fP"
Calculate the dimensions for the columns and rows for a grid of numColumns columns\&.
.PP
\fBParameters:\fP
.RS 4
\fInumColumns\fP Number of columns\&. 
.br
\fIrowHeight\fP Array where to fill in the calculated row heights\&. 
.br
\fIcolWidth\fP Array where to fill in the calculated column widths\&. 
.RE
.PP

.SS "QList< QRect > QwtDynGridLayout::layoutItems (const QRect &rect, uintnumColumns) const"
Calculate the geometries of the layout items for a layout with numColumns columns and a given rectangle\&.
.PP
\fBParameters:\fP
.RS 4
\fIrect\fP Rect where to place the items 
.br
\fInumColumns\fP Number of columns 
.RE
.PP
\fBReturns:\fP
.RS 4
item geometries 
.RE
.PP

.SS "uint QwtDynGridLayout::maxColumns () const"

.PP
Return the upper limit for the number of columns\&. 0 means unlimited, what is the default\&.
.PP
\fBReturns:\fP
.RS 4
Upper limit for the number of columns 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetMaxColumns()\fP 
.RE
.PP

.SS "int QwtDynGridLayout::maxItemWidth () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
the maximum width of all layout items 
.RE
.PP

.SS "uint QwtDynGridLayout::numColumns () const"

.PP
\fBReturns:\fP
.RS 4
Number of columns of the current layout\&. 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBnumRows()\fP 
.RE
.PP
\fBWarning:\fP
.RS 4
The number of columns might change whenever the geometry changes 
.RE
.PP

.SS "uint QwtDynGridLayout::numRows () const"

.PP
\fBReturns:\fP
.RS 4
Number of rows of the current layout\&. 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBnumColumns()\fP 
.RE
.PP
\fBWarning:\fP
.RS 4
The number of rows might change whenever the geometry changes 
.RE
.PP

.SS "void QwtDynGridLayout::setExpandingDirections (Qt::Orientationsexpanding)"
Set whether this layout can make use of more space than \fBsizeHint()\fP\&. 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\&.
.PP
\fBParameters:\fP
.RS 4
\fIexpanding\fP Or'd orientations 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBexpandingDirections()\fP 
.RE
.PP

.SS "void QwtDynGridLayout::setGeometry (const QRect &rect)\fC [virtual]\fP"
Reorganizes columns and rows and resizes managed items within a rectangle\&.
.PP
\fBParameters:\fP
.RS 4
\fIrect\fP Layout geometry 
.RE
.PP

.SS "void QwtDynGridLayout::setMaxColumns (uintmaxColumns)"
Limit the number of columns\&. 
.PP
\fBParameters:\fP
.RS 4
\fImaxColumns\fP upper limit, 0 means unlimited 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmaxColumns()\fP 
.RE
.PP

.SS "QSize QwtDynGridLayout::sizeHint () const\fC [virtual]\fP"
Return the size hint\&. If \fBmaxColumns()\fP > 0 it is the size for a grid with \fBmaxColumns()\fP columns, otherwise it is the size for a grid with only one row\&.
.PP
\fBReturns:\fP
.RS 4
Size hint 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmaxColumns()\fP, \fBsetMaxColumns()\fP 
.RE
.PP

.SS "void QwtDynGridLayout::stretchGrid (const QRect &rect, uintnumColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const\fC [protected]\fP"
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\&.
.PP
\fBParameters:\fP
.RS 4
\fIrect\fP Bounding rectangle 
.br
\fInumColumns\fP Number of columns 
.br
\fIrowHeight\fP Array to be filled with the calculated row heights 
.br
\fIcolWidth\fP Array to be filled with the calculated column widths
.RE
.PP
\fBSee Also:\fP
.RS 4
setExpanding(), expanding() 
.RE
.PP

.SS "QLayoutItem * QwtDynGridLayout::takeAt (intindex)\fC [virtual]\fP"
Find the item at a specific index and remove it from the layout
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index 
.RE
.PP
\fBReturns:\fP
.RS 4
Layout item, removed from the layout 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBitemAt()\fP 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.