QtBase
v6.3.1
|
The QGroupBox widget provides a group box frame with a title. More...
#include <qgroupbox.h>
Public Slots | |
void | setChecked (bool checked) |
Public Slots inherited from QWidget | |
void | setEnabled (bool) |
void | setDisabled (bool) |
void | setWindowModified (bool) |
void | setWindowTitle (const QString &) |
void | setStyleSheet (const QString &styleSheet) |
void | setFocus () |
void | update () |
void | repaint () |
virtual void | setVisible (bool visible) |
void | setHidden (bool hidden) |
void | show () |
void | hide () |
void | showMinimized () |
void | showMaximized () |
void | showFullScreen () |
void | showNormal () |
bool | close () |
void | raise () |
void | lower () |
Public Slots inherited from QObject | |
void | deleteLater () |
Signals | |
void | clicked (bool checked=false) |
void | toggled (bool) |
Signals inherited from QWidget | |
void | windowTitleChanged (const QString &title) |
void | windowIconChanged (const QIcon &icon) |
void | windowIconTextChanged (const QString &iconText) |
void | customContextMenuRequested (const QPoint &pos) |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
Properties | |
QString | title |
the group box title text More... | |
Qt::Alignment | alignment |
the alignment of the group box title. More... | |
bool | flat |
whether the group box is painted flat or has a frame More... | |
bool | checkable |
whether the group box has a checkbox in its title More... | |
bool | checked |
whether the group box is checked More... | |
Properties inherited from QWidget | |
bool | modal |
whether the widget is a modal widget More... | |
Qt::WindowModality | windowModality |
which windows are blocked by the modal widget More... | |
bool | enabled |
whether the widget is enabled More... | |
QRect | geometry |
the geometry of the widget relative to its parent and excluding the window frame More... | |
QRect | frameGeometry |
geometry of the widget relative to its parent including any window frame More... | |
QRect | normalGeometry |
the geometry of the widget as it will appear when shown as a normal (not maximized or full screen) top-level widget More... | |
int | x |
the x coordinate of the widget relative to its parent including any window frame More... | |
int | y |
the y coordinate of the widget relative to its parent and including any window frame More... | |
QPoint | pos |
the position of the widget within its parent widget More... | |
QSize | frameSize |
the size of the widget including any window frame More... | |
QSize | size |
the size of the widget excluding any window frame More... | |
int | width |
the width of the widget excluding any window frame More... | |
int | height |
the height of the widget excluding any window frame More... | |
QRect | rect |
the internal geometry of the widget excluding any window frame More... | |
QRect | childrenRect |
the bounding rectangle of the widget's children More... | |
QRegion | childrenRegion |
the combined region occupied by the widget's children More... | |
QSizePolicy | sizePolicy |
the default layout behavior of the widget More... | |
QSize | minimumSize |
the widget's minimum size More... | |
QSize | maximumSize |
the widget's maximum size in pixels More... | |
int | minimumWidth |
the widget's minimum width in pixels More... | |
int | minimumHeight |
the widget's minimum height in pixels More... | |
int | maximumWidth |
the widget's maximum width in pixels More... | |
int | maximumHeight |
the widget's maximum height in pixels More... | |
QSize | sizeIncrement |
the size increment of the widget More... | |
QSize | baseSize |
the base size of the widget More... | |
QPalette | palette |
the widget's palette More... | |
QFont | font |
the font currently set for the widget More... | |
QCursor | cursor |
the cursor shape for this widget More... | |
bool | mouseTracking |
whether mouse tracking is enabled for the widget More... | |
bool | tabletTracking |
whether tablet tracking is enabled for the widget More... | |
bool | isActiveWindow |
whether this widget's window is the active window More... | |
Qt::FocusPolicy | focusPolicy |
the way the widget accepts keyboard focus More... | |
bool | focus |
whether this widget (or its focus proxy) has the keyboard input focus More... | |
Qt::ContextMenuPolicy | contextMenuPolicy |
how the widget shows a context menu More... | |
bool | updatesEnabled |
whether updates are enabled More... | |
bool | visible |
whether the widget is visible More... | |
bool | minimized |
whether this widget is minimized (iconified) More... | |
bool | maximized |
whether this widget is maximized More... | |
bool | fullScreen |
whether the widget is shown in full screen mode More... | |
QSize | sizeHint |
the recommended size for the widget More... | |
QSize | minimumSizeHint |
the recommended minimum size for the widget More... | |
bool | acceptDrops |
whether drop events are enabled for this widget More... | |
QString | windowTitle |
the window title (caption) More... | |
QIcon | windowIcon |
the widget's icon More... | |
QString | windowIconText |
the text to be displayed on the icon of a minimized window More... | |
double | windowOpacity |
The level of opacity for the window. More... | |
bool | windowModified |
whether the document shown in the window has unsaved changes More... | |
QString | accessibleName |
the widget's name as seen by assistive technologies More... | |
QString | accessibleDescription |
the widget's description as seen by assistive technologies More... | |
Qt::LayoutDirection | layoutDirection |
the layout direction for this widget. More... | |
bool | autoFillBackground |
whether the widget background is filled automatically More... | |
QString | styleSheet |
the widget's style sheet More... | |
QLocale | locale |
the widget's locale More... | |
QString | windowFilePath |
the file path associated with a widget More... | |
Qt::InputMethodHints | inputMethodHints |
What input method specific hints the widget has. More... | |
Properties inherited from QObject | |
QString | objectName |
the name of this object More... | |
The QGroupBox widget provides a group box frame with a title.
\inmodule QtWidgets
A group box provides a frame, a title on top, a keyboard shortcut, and displays various other widgets inside itself. The keyboard shortcut moves keyboard focus to one of the group box's child widgets.
QGroupBox also lets you set the \l title (normally set in the constructor) and the title's \l alignment. Group boxes can be \l checkable. Child widgets in checkable group boxes are enabled or disabled depending on whether or not the group box is \l checked.
You can minimize the space consumption of a group box by enabling the \l flat property. In most \l{QStyle}{styles}, enabling this property results in the removal of the left, right and bottom edges of the frame.
QGroupBox doesn't automatically lay out the child widgets (which are often \l{QCheckBox}es or \l{QRadioButton}s but can be any widgets). The following example shows how we can set up a QGroupBox with a layout:
Definition at line 52 of file qgroupbox.h.
Constructs a group box widget with the given parent but with no title.
Definition at line 180 of file qgroupbox.cpp.
Constructs a group box with the given title and parent.
Definition at line 191 of file qgroupbox.cpp.
QGroupBox::~QGroupBox | ( | ) |
Destroys the group box.
Definition at line 201 of file qgroupbox.cpp.
Qt::Alignment QGroupBox::alignment | ( | ) | const |
Definition at line 286 of file qgroupbox.cpp.
\reimp
Reimplemented from QWidget.
Definition at line 674 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QObject.
Definition at line 389 of file qgroupbox.cpp.
This signal is emitted when the check box is activated (i.e., pressed down then released while the mouse cursor is inside the button), or when the shortcut key is typed. Notably, this signal is not emitted if you call setChecked().
If the check box is checked, checked is true; it is false if the check box is unchecked.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 319 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 469 of file qgroupbox.cpp.
|
protectedvirtual |
Initialize option with the values from this QGroupBox. This method is useful for subclasses when they need a QStyleOptionGroupBox, but don't want to fill in all the information themselves.
Definition at line 94 of file qgroupbox.cpp.
bool QGroupBox::isCheckable | ( | ) | const |
bool QGroupBox::isChecked | ( | ) | const |
Definition at line 589 of file qgroupbox.cpp.
bool QGroupBox::isFlat | ( | ) | const |
Definition at line 520 of file qgroupbox.cpp.
|
overridevirtual |
\reimp
Reimplemented from QWidget.
Definition at line 483 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 715 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 694 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 732 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 310 of file qgroupbox.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QWidget.
Definition at line 302 of file qgroupbox.cpp.
void QGroupBox::setAlignment | ( | int | alignment | ) |
void QGroupBox::setCheckable | ( | bool | checkable | ) |
Definition at line 553 of file qgroupbox.cpp.
|
slot |
Definition at line 633 of file qgroupbox.cpp.
void QGroupBox::setFlat | ( | bool | flat | ) |
Definition at line 526 of file qgroupbox.cpp.
Definition at line 223 of file qgroupbox.cpp.
QString QGroupBox::title | ( | ) | const |
Definition at line 262 of file qgroupbox.cpp.
|
signal |
If the group box is checkable, this signal is emitted when the check box is toggled. on is true if the check box is checked; otherwise, it is false.
|
readwrite |
the alignment of the group box title.
Most styles place the title at the top of the frame. The horizontal alignment of the title can be specified using single values from the following list:
\list
The default alignment is Qt::AlignLeft.
Definition at line 106 of file qgroupbox.h.
|
readwrite |
whether the group box has a checkbox in its title
If this property is true
, the group box displays its title using a checkbox in place of an ordinary label. If the checkbox is checked, the group box's children are enabled; otherwise, they are disabled and inaccessible.
By default, group boxes are not checkable.
If this property is enabled for a group box, it will also be initially checked to ensure that its contents are enabled.
Definition at line 106 of file qgroupbox.h.
|
readwrite |
whether the group box is checked
If the group box is checkable, it is displayed with a check box. If the check box is checked, the group box's children are enabled; otherwise, the children are disabled and are inaccessible to the user.
By default, checkable group boxes are also checked.
Definition at line 106 of file qgroupbox.h.
|
readwrite |
whether the group box is painted flat or has a frame
A group box usually consists of a surrounding frame with a title at the top. If this property is enabled, only the top part of the frame is drawn in most styles; otherwise, the whole frame is drawn.
By default, this property is disabled, i.e., group boxes are not flat unless explicitly specified.
{Note:} In some styles, flat and non-flat group boxes have similar representations and may not be as distinguishable as they are in other styles.
Definition at line 106 of file qgroupbox.h.
|
readwrite |
the group box title text
The group box title text will have a keyboard shortcut if the title contains an ampersand ('&') followed by a letter.
In the example above, \uicontrol Alt+U moves the keyboard focus to the group box. See the \l {QShortcut::mnemonic}{QShortcut} documentation for details (to display an actual ampersand, use '&&').
There is no default title text.
Definition at line 106 of file qgroupbox.h.