QGroupBox(3qt)
π QGroupBox(3qt) π
okay bestie, gather round, because today we're talking about QGroupBox β the manual page for it, specifically, straight out of the 3qt section. it's giving widget energy. it's giving group box frame with a title. and yes, we're doing the whole thing, every single flag, no skips. π
β¨ NAME β¨
QGroupBox β Group box frame with a title π«Ά
πΈ SYNOPSIS πΈ
#include <qgroupbox.h>
Inherits QFrame.
Inherited by QButtonGroup, QHGroupBox, and QVGroupBox. (yes bestie, the family tree is real, it's a whole dynasty π)
π¦ Public Members π¦
QGroupBox ( QWidget * parent = 0, const char * name = 0 )
QGroupBox ( const QString & title, QWidget * parent = 0, const char *
name = 0 )
QGroupBox ( int strips, Orientation orientation, QWidget * parent = 0,
const char * name = 0 )
QGroupBox ( int strips, Orientation orientation, const QString & title,
QWidget * parent = 0, const char * name = 0 )
~QGroupBox ()
virtual void setColumnLayout ( int strips, Orientation direction )
QString title () const
virtual void setTitle ( const QString & )
int alignment () const
virtual void setAlignment ( int )
int columns () const
void setColumns ( int )
Orientation orientation () const
void setOrientation ( Orientation )
int insideMargin () const
int insideSpacing () const
void setInsideMargin ( int m )
void setInsideSpacing ( int s )
void addSpace ( int size )
bool isFlat () const
void setFlat ( bool b )
bool isCheckable () const
void setCheckable ( bool b )
bool isChecked () const
π Public Slots π
void setChecked ( bool b )
β Signals β
void toggled ( bool on )
π Properties π
- Alignment
alignmentβ the alignment of the group box title - bool
checkableβ whether the group box has a checkbox in its title - bool
checkedβ whether the group box's checkbox is checked - int
columnsβ the number of columns or rows (depending onQGroupBox::orientation) in the group box - bool
flatβ whether the group box is painted flat or has a frame - Orientation
orientationβ the group box's orientation - QString
titleβ the group box title text
π DESCRIPTION π
The QGroupBox widget provides a group box frame with a title. literally that's the whole job and it does it gorgeously.
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. it's a little container with main character energy β the title is up top doing its thing, the shortcut teleports your focus to one of the kids, and the kids line up all neat inside. π§
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. easy. no cap.
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().
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 minimize space consumption, you can remove the right, left and bottom edges of the frame with setFlat(). slay, minimal footprint π
[Image Omitted] β yeah bestie the picture didn't make it into the text, we're all just vibing without it π«Ά
See also QButtonGroup, Widget Appearance and Style, Layout Management, and Organizers.
π MEMBER FUNCTION DOCUMENTATION π
QGroupBox::QGroupBox ( QWidget * parent = 0, const char * name = 0 )
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. like, zero layout help, you're on your own bestie π
QGroupBox::QGroupBox ( const QString & title, QWidget * parent = 0, const char * name = 0 )
Constructs a group box with the title title. cute.
The parent and name arguments are passed to the QWidget constructor.
This constructor does not do automatic layout.
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 strips rows or columns (depending on orientation).
The parent and name arguments are passed to the QWidget constructor.
QGroupBox::QGroupBox ( int strips, Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 )
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.
QGroupBox::~QGroupBox ()
Destroys the group box. bye bestie, it was iconic while it lasted π
void QGroupBox::addSpace ( int size )
Adds an empty cell at the next free position. If size is greater than 0, the empty cell takes size to be its fixed width (if orientation() is Horizontal) or height (if orientation() is Vertical).
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. β‘ order matters, do the setup first, add the stuff after.
int QGroupBox::alignment () const
Returns the alignment of the group box title. See the "alignment" property for details.
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.
int QGroupBox::insideMargin () const
Returns the width of the empty space between the items in the group and the frame of the group.
Only applies if the group box has a defined orientation.
The default is usually 11, by may vary depending on the platform and style. (yes, the manpage says "by may vary", we are reporting it faithfully, that's the rule π)
See also setInsideMargin() and orientation.
int QGroupBox::insideSpacing () const
Returns the width of the empty space between each of the items in the group.
Only applies if the group box has a defined orientation.
The default is usually 5, by may vary depending on the platform and style.
See also setInsideSpacing() and orientation.
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.
bool QGroupBox::isChecked () const
Returns TRUE if the group box's checkbox is checked; otherwise returns FALSE. See the "checked" property for details.
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.
Orientation QGroupBox::orientation () const
Returns the group box's orientation. See the "orientation" property for details.
void QGroupBox::setAlignment ( int ) [virtual]
Sets the alignment of the group box title. See the "alignment" property for details.
void QGroupBox::setCheckable ( bool b )
Sets whether the group box has a checkbox in its title to b. See the "checkable" property for details.
void QGroupBox::setChecked ( bool b ) [slot]
Sets whether the group box's checkbox is checked to b. See the "checked" property for details.
void QGroupBox::setColumnLayout ( int strips, Orientation direction ) [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. It is not good Qt programming style to call this function after children have been inserted. Sets the number of columns or rows to be strips, depending on direction.
See also orientation and columns.
Example: chart/optionsform.cpp.
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.
void QGroupBox::setFlat ( bool b )
Sets whether the group box is painted flat or has a frame to b. See the "flat" property for details.
void QGroupBox::setInsideMargin ( int m )
Sets the the width of the inside margin to m pixels. (again, "the the" β the original said it, we keep it, no edits π
)
See also insideMargin().
void QGroupBox::setInsideSpacing ( int s )
Sets the width of the empty space between each of the items in the group to s pixels.
See also insideSpacing().
void QGroupBox::setOrientation ( Orientation )
Sets the group box's orientation. See the "orientation" property for details.
void QGroupBox::setTitle ( const QString & ) [virtual]
Sets the group box title text. See the "title" property for details.
QString QGroupBox::title () const
Returns the group box title text. See the "title" property for details.
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. π£ it fires, it tells you, that's the vibe.
π Property Documentation π
Alignment 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:
AlignAutoaligns the title according to the language, usually to the left.AlignLeftaligns the title text to the left.AlignRightaligns the title text to the right.AlignHCenteraligns the title text centered.
The default alignment is AlignAuto.
See also Qt::AlignmentFlags.
Set this property's value with setAlignment() and get this property's value with alignment().
bool checkable
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.
Set this property's value with setCheckable() and get this property's value with isCheckable().
bool checked
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 (see isChecked()), the group box's children are enabled. If the checkbox is unchecked the children are disabled.
Set this property's value with setChecked() and get this property's value with isChecked().
int columns
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 best to set the number of columns directly in the constructor. β οΈ like, it works, but it's doing a whole layout every time, so set it in the constructor instead bestie.
Set this property's value with setColumns() and get this property's value with columns().
bool flat
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.
See also title.
Set this property's value with setFlat() and get this property's value with isFlat().
Orientation orientationβ this property holds the group box's orientation.
A horizontal group box arranges it's children in columns, while a vertical group box arranges them in rows.
Usually it is not a good idea to set this property because it is slow (it does a complete layout, bestie, like a whole entire one π). It is better to set the orientation directly in the constructor. Periodt.
Set this property's value with setOrientation() and get this property's value with orientation().
QString titleβ 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. iykyk β¨
g->setTitle( "&User information" );
This produces "<u>U</u>ser information"; Alt+U moves the keyboard focus to the group box. so cute, so handy π
There is no default title text.
Set this property's value with setTitle() and get this property's value with title().
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. fr fr, go read it π
π¦ AUTHOR π¦
Generated automatically from the source code. iconic, honestly
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you π
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt 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. no cap, they said it themselves
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qgroupbox.3qt) and the Qt version (3.3.8). give them the receipts π
okay that's literally the whole page, bestie, you ate it up π
β¨ This lil' gem is from Trolltech AS, dated 2 February 2007, and it lives under the name QGroupBox(3qt) β manifesting that your group boxes are always perfectly aligned π«ΆπΈ
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms