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
|
'\" t
.TH QGroupBox 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QGroupBox \- Group box frame with a title
.SH SYNOPSIS
\fC#include <ntqgroupbox.h>\fR
.PP
Inherits QFrame.
.PP
Inherited by QButtonGroup, QHGroupBox, and QVGroupBox.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQGroupBox\fR ( QWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQGroupBox\fR ( const QString & title, QWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQGroupBox\fR ( int strips, Orientation orientation, QWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQGroupBox\fR ( int strips, Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~QGroupBox\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetColumnLayout\fR ( int strips, Orientation direction )"
.br
.ti -1c
.BI "QString \fBtitle\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetTitle\fR ( const QString & )"
.br
.ti -1c
.BI "int \fBalignment\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetAlignment\fR ( int )"
.br
.ti -1c
.BI "int \fBcolumns\fR () const"
.br
.ti -1c
.BI "void \fBsetColumns\fR ( int )"
.br
.ti -1c
.BI "Orientation \fBorientation\fR () const"
.br
.ti -1c
.BI "void \fBsetOrientation\fR ( Orientation )"
.br
.ti -1c
.BI "int \fBinsideMargin\fR () const"
.br
.ti -1c
.BI "int \fBinsideSpacing\fR () const"
.br
.ti -1c
.BI "void \fBsetInsideMargin\fR ( int m )"
.br
.ti -1c
.BI "void \fBsetInsideSpacing\fR ( int s )"
.br
.ti -1c
.BI "void \fBaddSpace\fR ( int size )"
.br
.ti -1c
.BI "bool \fBisFlat\fR () const"
.br
.ti -1c
.BI "void \fBsetFlat\fR ( bool b )"
.br
.ti -1c
.BI "bool \fBisCheckable\fR () const"
.br
.ti -1c
.BI "void \fBsetCheckable\fR ( bool b )"
.br
.ti -1c
.BI "bool \fBisChecked\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBsetChecked\fR ( bool b )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBtoggled\fR ( bool on )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "Alignment \fBalignment\fR - the alignment of the group box title"
.br
.ti -1c
.BI "bool \fBcheckable\fR - whether the group box has a checkbox in its title"
.br
.ti -1c
.BI "bool \fBchecked\fR - whether the group box's checkbox is checked"
.br
.ti -1c
.BI "int \fBcolumns\fR - the number of columns or rows (depending on \\l QGroupBox::orientation) in the group box"
.br
.ti -1c
.BI "bool \fBflat\fR - whether the group box is painted flat or has a frame"
.br
.ti -1c
.BI "Orientation \fBorientation\fR - the group box's orientation"
.br
.ti -1c
.BI "QString \fBtitle\fR - the group box title text"
.br
.in -1c
.SH DESCRIPTION
The QGroupBox widget provides a group box frame with a title.
.PP
A group box provides a frame, a title and a keyboard shortcut, and displays various other widgets inside itself. The title is on top, the keyboard shortcut moves keyboard focus to one of the group box's child widgets, and the child widgets are usually laid out horizontally (or vertically) inside the frame.
.PP
The simplest way to use it is to create a group box with the desired number of columns (or rows) and orientation, and then just create widgets with the group box as parent.
.PP
It is also possible to change the orientation() and number of columns() after construction, or to ignore all the automatic layout support and manage the layout yourself. You can add 'empty' spaces to the group box with addSpace().
.PP
QGroupBox also lets you set the title() (normally set in the constructor) and the title's alignment().
.PP
You can change the spacing used by the group box with setInsideMargin() and setInsideSpacing(). To minimize space consumption, you can remove the right, left and bottom edges of the frame with setFlat().
.PP
.ce 1
.B "[Image Omitted]"
.PP
See also QButtonGroup, Widget Appearance and Style, Layout Management, and Organizers.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QGroupBox::QGroupBox ( QWidget * parent = 0, const char * name = 0 )"
Constructs a group box widget with no title.
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor.
.PP
This constructor does not do automatic layout.
.SH "QGroupBox::QGroupBox ( const QString & title, QWidget * parent = 0, const char * name = 0 )"
Constructs a group box with the title \fItitle\fR.
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor.
.PP
This constructor does not do automatic layout.
.SH "QGroupBox::QGroupBox ( int strips, Orientation orientation, QWidget * parent = 0, const char * name = 0 )"
Constructs a group box with no title. Child widgets will be arranged in \fIstrips\fR rows or columns (depending on \fIorientation\fR).
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor.
.SH "QGroupBox::QGroupBox ( int strips, Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 )"
Constructs a group box titled \fItitle\fR. Child widgets will be arranged in \fIstrips\fR rows or columns (depending on \fIorientation\fR).
.PP
The \fIparent\fR and \fIname\fR arguments are passed to the QWidget constructor.
.SH "QGroupBox::~QGroupBox ()"
Destroys the group box.
.SH "void QGroupBox::addSpace ( int size )"
Adds an empty cell at the next free position. If \fIsize\fR is greater than 0, the empty cell takes \fIsize\fR to be its fixed width (if orientation() is Horizontal) or height (if orientation() is Vertical).
.PP
Use this method to separate the widgets in the group box or to skip the next free cell. For performance reasons, call this method after calling setColumnLayout() or by changing the QGroupBox::columns or QGroupBox::orientation properties. It is generally a good idea to call these methods first (if needed at all), and insert the widgets and spaces afterwards.
.SH "int QGroupBox::alignment () const"
Returns the alignment of the group box title. See the "alignment" property for details.
.SH "int QGroupBox::columns () const"
Returns the number of columns or rows (depending on QGroupBox::orientation) in the group box. See the "columns" property for details.
.SH "int QGroupBox::insideMargin () const"
Returns the width of the empty space between the items in the group and the frame of the group.
.PP
Only applies if the group box has a defined orientation.
.PP
The default is usually 11, by may vary depending on the platform and style.
.PP
See also setInsideMargin() and orientation.
.SH "int QGroupBox::insideSpacing () const"
Returns the width of the empty space between each of the items in the group.
.PP
Only applies if the group box has a defined orientation.
.PP
The default is usually 5, by may vary depending on the platform and style.
.PP
See also setInsideSpacing() and orientation.
.SH "bool QGroupBox::isCheckable () const"
Returns TRUE if the group box has a checkbox in its title; otherwise returns FALSE. See the "checkable" property for details.
.SH "bool QGroupBox::isChecked () const"
Returns TRUE if the group box's checkbox is checked; otherwise returns FALSE. See the "checked" property for details.
.SH "bool QGroupBox::isFlat () const"
Returns TRUE if the group box is painted flat or has a frame; otherwise returns FALSE. See the "flat" property for details.
.SH "Orientation QGroupBox::orientation () const"
Returns the group box's orientation. See the "orientation" property for details.
.SH "void QGroupBox::setAlignment ( int )\fC [virtual]\fR"
Sets the alignment of the group box title. See the "alignment" property for details.
.SH "void QGroupBox::setCheckable ( bool b )"
Sets whether the group box has a checkbox in its title to \fIb\fR. See the "checkable" property for details.
.SH "void QGroupBox::setChecked ( bool b )\fC [slot]\fR"
Sets whether the group box's checkbox is checked to \fIb\fR. See the "checked" property for details.
.SH "void QGroupBox::setColumnLayout ( int strips, Orientation direction )\fC [virtual]\fR"
Changes the layout of the group box. This function is only useful in combination with the default constructor that does not take any layout information. This function will put all existing children in the new layout. It is not good TQt programming style to call this function after children have been inserted. Sets the number of columns or rows to be \fIstrips\fR, depending on \fIdirection\fR.
.PP
See also orientation and columns.
.PP
Example: chart/optionsform.cpp.
.SH "void QGroupBox::setColumns ( int )"
Sets the number of columns or rows (depending on QGroupBox::orientation) in the group box. See the "columns" property for details.
.SH "void QGroupBox::setFlat ( bool b )"
Sets whether the group box is painted flat or has a frame to \fIb\fR. See the "flat" property for details.
.SH "void QGroupBox::setInsideMargin ( int m )"
Sets the the width of the inside margin to \fIm\fR pixels.
.PP
See also insideMargin().
.SH "void QGroupBox::setInsideSpacing ( int s )"
Sets the width of the empty space between each of the items in the group to \fIs\fR pixels.
.PP
See also insideSpacing().
.SH "void QGroupBox::setOrientation ( Orientation )"
Sets the group box's orientation. See the "orientation" property for details.
.SH "void QGroupBox::setTitle ( const QString & )\fC [virtual]\fR"
Sets the group box title text. See the "title" property for details.
.SH "QString QGroupBox::title () const"
Returns the group box title text. See the "title" property for details.
.SH "void QGroupBox::toggled ( bool on )\fC [signal]\fR"
If the group box has a check box (see isCheckable()) this signal is emitted when the check box is toggled. \fIon\fR is TRUE if the check box is checked; otherwise it is FALSE.
.SS "Property Documentation"
.SH "Alignment alignment"
This property holds the alignment of the group box title.
.PP
The title is always placed on the upper frame line. The horizontal alignment can be specified by the alignment parameter.
.PP
The alignment is one of the following flags:
.TP
AlignAuto aligns the title according to the language, usually to the left.
.TP
AlignLeft aligns the title text to the left.
.TP
AlignRight aligns the title text to the right.
.TP
AlignHCenter aligns the title text centered.
.PP
The default alignment is AlignAuto.
.PP
See also Qt::AlignmentFlags.
.PP
Set this property's value with setAlignment() and get this property's value with alignment().
.SH "bool checkable"
This property holds whether the group box has a checkbox in its title.
.PP
If this property is TRUE, the group box has a checkbox. If the checkbox is checked (which is the default), the group box's children are enabled.
.PP
setCheckable() controls whether or not the group box has a checkbox, and isCheckable() controls whether the checkbox is checked or not.
.PP
Set this property's value with setCheckable() and get this property's value with isCheckable().
.SH "bool checked"
This property holds whether the group box's checkbox is checked.
.PP
If the group box has a check box (see isCheckable()), and the check box is checked (see isChecked()), the group box's children are enabled. If the checkbox is unchecked the children are disabled.
.PP
Set this property's value with setChecked() and get this property's value with isChecked().
.SH "int columns"
This property holds the number of columns or rows (depending on QGroupBox::orientation) in the group box.
.PP
Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is best to set the number of columns directly in the constructor.
.PP
Set this property's value with setColumns() and get this property's value with columns().
.SH "bool flat"
This property holds whether the group box is painted flat or has a frame.
.PP
By default a group box has a surrounding frame, with the title being placed on the upper frame line. In flat mode the right, left and bottom frame lines are omitted, and only the thin line at the top is drawn.
.PP
See also title.
.PP
Set this property's value with setFlat() and get this property's value with isFlat().
.SH "Orientation orientation"
This property holds the group box's orientation.
.PP
A horizontal group box arranges it's children in columns, while a vertical group box arranges them in rows.
.PP
Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is better to set the orientation directly in the constructor.
.PP
Set this property's value with setOrientation() and get this property's value with orientation().
.SH "QString title"
This property holds the group box title text.
.PP
The group box title text will have a focus-change keyboard accelerator if the title contains &, followed by a letter.
.PP
.nf
.br
g->setTitle( "&User information" );
.br
.fi
This produces "<u>U</u>ser information"; Alt+U moves the keyboard focus to the group box.
.PP
There is no default title text.
.PP
Set this property's value with setTitle() and get this property's value with title().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqgroupbox.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqgroupbox.3qt) and the Qt
version (3.3.8).
|