11#if QT_CONFIG(radiobutton)
17#if QT_CONFIG(accessibility)
20#include <private/qwidget_p.h>
21#include <private/qguiapplication_p.h>
22#include <qpa/qplatformtheme.h>
70 option->textAlignment = Qt::Alignment(
d->align);
71 option->activeSubControls |=
d->pressedControl;
91 if (!
d->title.isEmpty())
175#ifndef QT_NO_SHORTCUT
195#ifndef QT_NO_SHORTCUT
203#if QT_CONFIG(accessibility)
204 QAccessibleEvent
event(
this, QAccessible::NameChanged);
205 QAccessible::updateAccessibility(&
event);
288#ifndef QT_NO_SHORTCUT
291 if (se->shortcutId() ==
d->shortcutId) {
310 bool oldHover =
d->hover;
312 if (oldHover !=
d->hover) {
368 if (!(
c->added() ||
c->polished()) || !
c->child()->isWidgetType())
378 if (
w->isEnabled()) {
379 w->setEnabled(
false);
398 if (!fw || fw ==
q) {
402 while ((
w =
w->nextInFocusChain()) !=
q) {
404#if QT_CONFIG(radiobutton)
405 if (!best && qobject_cast<QRadioButton*>(
w) && ((
QRadioButton*)
w)->isChecked())
432 q->initStyleOption(&
box);
434 q->setContentsMargins(contentsRect.
left() -
box.rect.left(), contentsRect.
top() -
box.rect.top(),
435 box.rect.right() - contentsRect.
right(),
box.rect.bottom() - contentsRect.
bottom());
463 int baseWidth =
metrics.horizontalAdvance(
d->title) +
metrics.horizontalAdvance(u
' ');
464 int baseHeight =
metrics.height();
529 bool wasCheckable =
d->checkable;
536 d->_q_setChildrenEnabled(
true);
542 d->_q_setChildrenEnabled(
true);
545 d->_q_setChildrenEnabled(
true);
564 return d->checkable &&
d->checked;
608 if (
d->checkable &&
b !=
d->checked) {
611 d->_q_setChildrenEnabled(
b);
612#if QT_CONFIG(accessibility)
615 QAccessibleStateChangeEvent
e(
this, st);
616 QAccessible::updateAccessibility(&
e);
630 if (
o->isWidgetType()) {
636 if (
w->isEnabled()) {
637 w->setEnabled(
false);
653 d->_q_setChildrenEnabled(
false);
677 event->position().toPoint(),
this);
679 d->overCheckBox =
true;
693 event->position().toPoint(),
this);
694 bool oldOverCheckBox =
d->overCheckBox;
697 && (
d->overCheckBox != oldOverCheckBox))
712 if (!
d->overCheckBox) {
719 event->position().toPoint(),
this);
723 d->overCheckBox =
false;
726 else if (
d->checkable)
732#include "moc_qgroupbox.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
Type type() const
Returns the event type.
The QFocusEvent class contains event parameters for widget focus events.
Qt::FocusReason reason() const
Returns the reason for this focus event.
\reentrant \inmodule QtGui
QStyle::SubControl pressedControl
void _q_setChildrenEnabled(bool b)
void _q_fixFocus(Qt::FocusReason reason)
The QGroupBox widget provides a group box frame with a title.
void paintEvent(QPaintEvent *event) override
\reimp
QString title
the group box title text
virtual void initStyleOption(QStyleOptionGroupBox *option) const
Initialize option with the values from this QGroupBox.
void mouseReleaseEvent(QMouseEvent *event) override
\reimp
QGroupBox(QWidget *parent=nullptr)
Constructs a group box widget with the given parent but with no title.
void mousePressEvent(QMouseEvent *event) override
\reimp
void resizeEvent(QResizeEvent *event) override
\reimp
void toggled(bool)
If the group box is checkable, this signal is emitted when the check box is toggled.
bool event(QEvent *event) override
\reimp
void childEvent(QChildEvent *event) override
\reimp
bool checkable
whether the group box has a checkbox in its title
void mouseMoveEvent(QMouseEvent *event) override
\reimp
void setChecked(bool checked)
void setCheckable(bool checkable)
void changeEvent(QEvent *event) override
\reimp
void setAlignment(int alignment)
Qt::Alignment alignment
the alignment of the group box title.
~QGroupBox()
Destroys the group box.
void focusInEvent(QFocusEvent *event) override
\reimp
QSize minimumSizeHint() const override
\reimp
void setTitle(const QString &title)
static QPlatformTheme * platformTheme()
The QKeyEvent class describes a key event.
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
int key() const
Returns the code of the key that was pressed or released.
static QKeySequence mnemonic(const QString &text)
Returns the shortcut key sequence for the mnemonic in text, or an empty key sequence if no mnemonics ...
The QPaintEvent class contains event parameters for paint events.
\inmodule QtCore\reentrant
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QResizeEvent class contains event parameters for resize events.
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\variable QStyleOptionFrame::features
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SH_GroupBox_TextLabelColor
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=nullptr) const =0
Returns the sub control at the given position in the given complex control (with the style options sp...
@ PM_CheckBoxLabelSpacing
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
SubControl
This enum describes the available sub controls.
Combined button and popup list for selecting options.
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
GLsizei const GLint * box
GLdouble GLdouble GLdouble GLdouble q
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent