The QGroupBox widget provides a group box frame with a title. More...
#include <qgroupbox.h>
Inherits QFrame.
Inherited by QButtonGroup, QHGroupBox and QVGroupBox.
Type | Name | READ | WRITE | Options |
---|---|---|---|---|
QString | title | title | setTitle | |
Alignment | alignment | alignment | setAlignment | |
Orientation | orientation | orientation | setOrientation | DESIGNABLE false |
int | columns | columns | setColumns | DESIGNABLE false |
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' 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 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.
QGroupBox also lets you set the title() (normally set in the constructor) and if you so please, even the title's alignment().
See also QButtonGroup.
Constructs a group box widget with no title.
The parent and name arguments are passed to the QWidget constructor.
This constructor does not do automatic layout.
Constructs a group box with a title.
The parent and name arguments are passed to the QWidget constructor.
This constructor does not do automatic layout.
Constructs a group box with no title. Child widgets will be arranged in strips rows or columns (depending on orientation).
The parent and name arguments are passed to the QWidget constructor.
Constructs a group box titled title. Child widgets will be arranged in strips rows or columns (depending on orientation).
The parent and name arguments are passed to the QWidget constructor.
Adds an empty cell at the next free position. If size is greater than 0 then the empty cell has a fixed height or width. If the groupbox is oriented horizontally then the empty cell has a fixed height and if oriented vertically it has a fixed width.
Use this method to separate the widgets in the groupbox or to skip the next free cell. For performance reasons call this method after calling setColumnLayout(), setColumns() or setOrientation(). It is in general 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.
The default alignment is AlignLeft.
See also setAlignment() and Qt::AlignmentFlags.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QObject.
Returns the numbers of columns in the groupbox as passed to the constructor, setColumns() or setColumnLayout().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QObject.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Returns the current orientation of the groupbox.
See also setOrientation().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual]
Sets 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:
AlignLeft
aligns the title text to the left.
AlignRight
aligns the title text to the right.
AlignHCenter
aligns the title text centered.
See also alignment() and Qt::AlignmentFlags.
[virtual]
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. Nevertheless is is not good programming style to call this function after children have been inserted.
See also setOrientation() and setColumns().
Changes the numbers of columns to c. Usually it is no good idea to use the method since it is slow (it does a complete layout). Better set the numbers of columns directly in the constructor.
See also column() and setColumnLayout().
Changes the orientation of the groupbox. Usually it is no good idea to use the method since it is slow (it does a complete layout). Better set the orientation directly in the constructor.
See also orientation().
[virtual]
Sets the group box title text to title, and add a focus-change accelerator if the title contains & followed by an appropriate letter. This produces "User information" with the U underscored and Alt-U moves the keyboard focus into the group:
g->setTitle( "&User information" );
[virtual]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Returns the group box title text.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.2.1
|