Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

QGroupBox Class Reference
[QtGui module]

The QGroupBox widget provides a group box frame with a title. More...

#include <QGroupBox>

Inherits QWidget.

Inherited by Q3GroupBox.

Properties

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

The QGroupBox widget provides a group box frame with a title.

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.

QGroupBox also lets you set the title (normally set in the constructor) and the title's alignment(). If setCheckable(true) is called then the group box is isCheckable(), and it can be setChecked(). Checkable group boxes child widgets are enabled or disabled depending on whether or not the group box is isChecked().

To minimize space consumption, you can remove the right, left and bottom edges of the frame with setFlat().

Screenshot in Plastique style Screenshot in Windows style

See also QButtonGroup.


Property Documentation

alignment : Qt::Alignment

This property holds the alignment of the group box title.

The title is always placed on the upper frame line. The horizontal alignment can be specified by the alignment parameter.

The alignment is one of the following flags:

The default alignment is Qt::AlignLeft.

Access functions:

See also Qt::Alignment.

checkable : bool

This property holds whether the group box has a checkbox in its title.

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.

setCheckable() controls whether or not the group box has a checkbox, and isCheckable() controls whether the checkbox is checked or not.

Access functions:

checked : bool

This property holds whether the group box's checkbox is checked.

If the group box has a check box (see isCheckable()), and the check box is checked, the group box's children are enabled. If the checkbox is unchecked the children are disabled.

Access functions:

flat : bool

This property holds whether the group box is painted flat or has a frame.

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.

Access functions:

See also title.

title : QString

This property holds the group box title text.

The group box title text will have a focus-change keyboard shortcut if the title contains &, followed by a letter.

    g->setTitle("&User information");

This produces "User information"; Alt+U moves the keyboard focus to the group box.

There is no default title text.

Access functions:


Member Function Documentation

QGroupBox::QGroupBox ( QWidget * parent = 0 )

Constructs a group box widget with no title and parent parent.

QGroupBox::QGroupBox ( const QString & title, QWidget * parent = 0 )

Constructs a group box with the title title and parent parent.

QGroupBox::~QGroupBox ()

Destroys the group box.

void QGroupBox::toggled ( bool on )   [signal]

If the group box has a check box (see isCheckable()) this signal is emitted when the check box is toggled. on is true if the check box is checked; otherwise it is false.


Copyright © 2005 Trolltech Trademarks
Qt 4.1.0
Hosted by uCoz