diff options
Diffstat (limited to 'src/templates/qquicklabel.cpp')
-rw-r--r-- | src/templates/qquicklabel.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/templates/qquicklabel.cpp b/src/templates/qquicklabel.cpp index 13ff3a6e..e9fb274d 100644 --- a/src/templates/qquicklabel.cpp +++ b/src/templates/qquicklabel.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE \instantiates QQuickLabel \inqmlmodule Qt.labs.controls \ingroup text - \brief A text label. + \brief A text label with inherited styling and font. Label extends \l Text with styling and \l {Control::font}{font} inheritance. The default colors and font are style specific. Label @@ -83,7 +83,7 @@ QQuickLabel::~QQuickLabel() } QQuickLabelPrivate::QQuickLabelPrivate() - : background(Q_NULLPTR), accessibleAttached(Q_NULLPTR) + : background(nullptr), accessibleAttached(nullptr) { #ifndef QT_NO_ACCESSIBILITY QAccessible::installActivationObserver(this); @@ -195,16 +195,17 @@ QQuickItem *QQuickLabel::background() const void QQuickLabel::setBackground(QQuickItem *background) { Q_D(QQuickLabel); - if (d->background != background) { - delete d->background; - d->background = background; - if (background) { - background->setParentItem(this); - if (qFuzzyIsNull(background->z())) - background->setZ(-1); - } - emit backgroundChanged(); + if (d->background == background) + return; + + delete d->background; + d->background = background; + if (background) { + background->setParentItem(this); + if (qFuzzyIsNull(background->z())) + background->setZ(-1); } + emit backgroundChanged(); } void QQuickLabel::classBegin() |