diff options
Diffstat (limited to 'src/templates/qquickgroupbox.cpp')
-rw-r--r-- | src/templates/qquickgroupbox.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/templates/qquickgroupbox.cpp b/src/templates/qquickgroupbox.cpp index 84944987..33f7c672 100644 --- a/src/templates/qquickgroupbox.cpp +++ b/src/templates/qquickgroupbox.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE \instantiates QQuickGroupBox \inqmlmodule Qt.labs.controls \ingroup qtlabscontrols-containers - \brief A group box control. + \brief A frame with a logical group of controls. GroupBox is used to layout a logical group of controls together, within a titled visual frame. GroupBox does not provide a layout of its own, but @@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE class QQuickGroupBoxPrivate : public QQuickFramePrivate { public: - QQuickGroupBoxPrivate() : label(Q_NULLPTR) { } + QQuickGroupBoxPrivate() : label(nullptr) { } QString title; QQuickItem *label; @@ -108,10 +108,11 @@ QString QQuickGroupBox::title() const void QQuickGroupBox::setTitle(const QString &title) { Q_D(QQuickGroupBox); - if (d->title != title) { - d->title = title; - emit titleChanged(); - } + if (d->title == title) + return; + + d->title = title; + emit titleChanged(); } /*! @@ -130,13 +131,14 @@ QQuickItem *QQuickGroupBox::label() const void QQuickGroupBox::setLabel(QQuickItem *label) { Q_D(QQuickGroupBox); - if (d->label != label) { - delete d->label; - d->label = label; - if (label && !label->parentItem()) - label->setParentItem(this); - emit labelChanged(); - } + if (d->label == label) + return; + + delete d->label; + d->label = label; + if (label && !label->parentItem()) + label->setParentItem(this); + emit labelChanged(); } QFont QQuickGroupBox::defaultFont() const |