Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QGroupBox widget provides a group box frame with a title. More...
#include <qgroupbox.h>
Inherits QFrame.
Inherited by QButtonGroup, QHGroupBox, and QVGroupBox.
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 arranged in an array inside the frame.
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.
However, it is also possible to change the orientation() and number of columns() after construction, or to ignore all the automatic layout support and manage all that yourself. You can add 'empty' spaces to the group box with addSpace().
QGroupBox also lets you set the title() (normally set in the constructor) and the title's alignment().
You can change the spacing used by the group box with setInsideMargin() and setInsideSpacing(). To reduce space consumption, you can remove the right, left and bottom edges of the frame with setFlat().
See also QButtonGroup, Widget Appearance and Style, Layout Management, and Organizers.
The parent and name arguments are passed to the QWidget constructor.
This constructor does not do automatic layout.
The parent and name arguments are passed to the QWidget constructor.
This constructor does not do automatic layout.
The parent and name arguments are passed to the QWidget constructor.
The parent and name arguments are passed to the QWidget constructor.
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.
Returns the alignment of the group box title. See the "alignment" property for details.
Returns the number of columns or rows (depending on QGroupBox::orientation) in the group box. See the "columns" property for details.
Only applies if the group box has a defined orientation.
The default is about 11.
See also setInsideMargin() and orientation.
Only applies if the group box has a defined orientation.
The default is about 5.
See also setInsideSpacing() and orientation.
Returns TRUE if the group box is painted flat or has a frame around it; otherwise returns FALSE. See the "flat" property for details.
Returns the current orientation of the group box. See the "orientation" property for details.
Sets the alignment of the group box title. See the "alignment" property for details.
See also orientation and columns.
Example: chart/optionsform.cpp.
Sets the number of columns or rows (depending on QGroupBox::orientation) in the group box. See the "columns" property for details.
Sets whether the group box is painted flat or has a frame around it to b. See the "flat" property for details.
See also insideSpacing().
Sets the current orientation of the group box. See the "orientation" property for details.
Sets the group box title text. See the "title" property for details.
Returns the group box title text. See the "title" property for details.
This property holds the alignment of the group box title.
The title is always placed on the upper frame line; however, the horizontal alignment can be specified by the alignment parameter.
The alignment is one of the following flags:
The default alignment is AlignAuto.
See also Qt::AlignmentFlags.
Set this property's value with setAlignment() and get this property's value with alignment().
This property holds the number of columns or rows (depending on QGroupBox::orientation) in the group box.
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 number of columns directly in the constructor.
Set this property's value with setColumns() and get this property's value with columns().
This property holds whether the group box is painted flat or has a frame around it.
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.
See also title.
Set this property's value with setFlat() and get this property's value with isFlat().
This property holds the current orientation of the group box.
A horizontal group box arranges it's children in columns, while a vertical group box arranges them in rows. Thus, a horizontal group box with only one column will arrange the children vertically in that column.
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.
Set this property's value with setOrientation() and get this property's value with orientation().
This property holds the group box title text.
The group box title text will have a focus-change keyboard accelerator if the title contains &, followed by a letter.
g->setTitle( "&User information" );This produces "User information" with the U underlined; Alt+U moves the keyboard focus to the group box.
There is no default title text.
Set this property's value with setTitle() and get this property's value with title().
This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.
Copyright © 2003 Trolltech | Trademarks | Qt version 3.1.2
|