43 #ifndef QT_NO_GROUPBOX 53 #ifndef QT_NO_ACCESSIBILITY 56 #include <private/qwidget_p.h> 72 #ifndef QT_NO_SHORTCUT 101 option->
text =
d->title;
129 if (!
d->title.isEmpty())
225 #ifndef QT_NO_SHORTCUT 232 overCheckBox =
false;
242 if (
d->title == title)
245 #ifndef QT_NO_SHORTCUT 253 #ifndef QT_NO_ACCESSIBILITY 343 #ifndef QT_NO_SHORTCUT 363 static_cast<QHoverEvent *>(e)->
pos(),
365 bool oldHover =
d->hover;
367 if (oldHover !=
d->hover) {
444 if (!fw || fw == q) {
450 if (!best && qobject_cast<QRadioButton*>(w) && ((
QRadioButton*)w)->isChecked())
476 q->initStyleOption(&box);
508 int baseHeight = metrics.
height();
579 bool wasCheckable =
d->checkable;
586 d->_q_setChildrenEnabled(
true);
592 d->_q_setChildrenEnabled(
true);
595 d->_q_setChildrenEnabled(
true);
598 if (wasCheckable != checkable) {
614 return d->checkable &&
d->checked;
667 if (
d->checkable && b !=
d->checked) {
670 d->_q_setChildrenEnabled(b);
671 #ifndef QT_NO_ACCESSIBILITY 686 for (
int i = 0; i < childList.
size(); ++i) {
711 d->_q_setChildrenEnabled(
false);
737 d->overCheckBox =
true;
750 bool oldOverCheckBox =
d->overCheckBox;
753 && (
d->overCheckBox != oldOverCheckBox))
766 if (!
d->overCheckBox) {
777 d->overCheckBox =
false;
780 else if (
d->checkable)
809 #endif // QT3_SUPPORT 813 #include "moc_qgroupbox.cpp" 815 #endif //QT_NO_GROUPBOX
The QColor class provides colors based on RGB, HSV or CMYK values.
QString text
the text of the group box
void setAlignment(int alignment)
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
int width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
void initStyleOption(QStyleOptionGroupBox *option) const
Initialize option with the values from this QGroupBox.
The QKeyEvent class describes a key event.
SubControl
This enum describes the available sub controls.
bool event(QEvent *event)
Reimplemented Function
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
void setChecked(bool checked)
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
bool flat
whether the group box is painted flat or has a frame
Qt::Alignment alignment() const
QGroupBox(QWidget *parent=0)
Constructs a group box widget with the given parent but with no title.
QStyle::State state
the style flags that are used when drawing the control
The QFlag class is a helper data type for QFlags.
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
static QKeySequence mnemonic(const QString &text)
Returns the shortcut key sequence for the mnemonic in text, or an empty key sequence if no mnemonics ...
QStyleOptionFrameV2::FrameFeatures features
the features of the group box frame
void _q_setChildrenEnabled(bool b)
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
bool checked
whether the group box is checked
int left() const
Returns the x-coordinate of the rectangle's left edge.
void changeEvent(QEvent *event)
Reimplemented Function
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
Qt::Alignment textAlignment
the alignment of the group box title
The QObject class is the base class of all Qt objects.
The QPointer class is a template class that provides guarded pointers to QObject. ...
void mouseReleaseEvent(QMouseEvent *event)
Reimplemented Function
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
void setObjectName(const QString &name)
void focusInEvent(QFocusEvent *event)
Reimplemented Function
int key() const
Returns the code of the key that was pressed or released.
void _q_fixFocus(Qt::FocusReason reason)
This private slot finds a widget in this group box that can accept focus, and gives the focus to that...
void setCheckable(bool checkable)
#define QT_BEGIN_NAMESPACE
This macro expands to.
void toggled(bool)
If the group box is checkable, this signal is emitted when the check box is toggled.
void childEvent(QChildEvent *event)
This event handler can be reimplemented in a subclass to receive child events.
void initFrom(const QWidget *w)
const T & at(int i) const
Returns the item at index position i in the list.
The QResizeEvent class contains event parameters for resize events.
The QGroupBox widget provides a group box frame with a title.
Qt::MouseButton button() const
Returns the button that caused the event.
The QMouseEvent class contains parameters that describe a mouse event.
The QChildEvent class contains event parameters for child object events.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
QPalette palette
the palette that should be used when painting the control
QStyle::SubControl pressedControl
int shortcutId()
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
int top() const
Returns the y-coordinate of the rectangle's top edge.
bool checkable
whether the group box has a checkbox in its title
#define Q_DECLARE_PUBLIC(Class)
int right() const
Returns the x-coordinate of the rectangle's right edge.
void mouseMoveEvent(QMouseEvent *event)
Reimplemented Function
void setTitle(const QString &title)
int midLineWidth
the mid-line width for drawing the panel
bool isBrushSet(ColorGroup cg, ColorRole cr) const
Returns true if the ColorGroup cg and ColorRole cr has been set previously on this palette; otherwise...
void resizeEvent(QResizeEvent *event)
Reimplemented Function
int lineWidth
the line width for drawing the panel
QSize minimumSizeHint() const
Reimplemented Function
QObject * parent() const
Returns a pointer to the parent object.
int size() const
Returns the number of items in the list.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
The QStyleOptionGroupBox class describes the parameters for drawing a group box.
The QRect class defines a rectangle in the plane using integer precision.
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
void mousePressEvent(QMouseEvent *event)
Reimplemented Function
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=0) const =0
Returns the sub control at the given position in the given complex control (with the style options sp...
QColor textColor
the color of the group box title
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
The QSize class defines the size of a two-dimensional object using integer point precision.
void drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex &opt)
Use the widget's style to draw a complex control cc specified by the QStyleOptionComplex option...
int height() const
Returns the height of the font.
The QPaintEvent class contains event parameters for paint events.
static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect *rect, Qt::LayoutDirection dir)
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
~QGroupBox()
Destroys the group box.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QRect rect
the area that should be used for various calculations and painting
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
The QFocusEvent class contains event parameters for widget focus events.
QObject * child() const
Returns the child object that was added or removed.
void paintEvent(QPaintEvent *event)
Reimplemented Function