aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicklabel.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-01-19 12:33:01 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-01-19 12:58:21 +0000
commit17ee616c3462836c93a0a322bc944d5f1a2266dc (patch)
tree8105ba30627d3f95b493805ec3edadc80a9d2ade /src/quicktemplates2/qquicklabel.cpp
parentb43e62ce6d989f2da1457561365e1fe3596e7561 (diff)
Cleanup QQuickLabel
Organize QQuickLabelPrivate methods first, in the same order as they are declared in the header, and then the QQuickLabel methods, instead of mixing them randomly. Also, remove an empty destructor, declaration of a non-existing resizeBackground() method, apply some cosmetic coding style tweaks, remove an unused include... Change-Id: If9b956c857f9e5c0f8126aa3d398beab16031464 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicklabel.cpp')
-rw-r--r--src/quicktemplates2/qquicklabel.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/quicktemplates2/qquicklabel.cpp b/src/quicktemplates2/qquicklabel.cpp
index 21a6da7e..108e92e4 100644
--- a/src/quicktemplates2/qquicklabel.cpp
+++ b/src/quicktemplates2/qquicklabel.cpp
@@ -41,7 +41,6 @@
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickclipnode_p.h>
#ifndef QT_NO_ACCESSIBILITY
#include <QtQuick/private/qquickaccessibleattached_p.h>
@@ -79,18 +78,6 @@ QT_BEGIN_NAMESPACE
\sa {Customizing Label}
*/
-QQuickLabel::QQuickLabel(QQuickItem *parent)
- : QQuickText(*(new QQuickLabelPrivate), parent)
-{
- Q_D(QQuickLabel);
- QObjectPrivate::connect(this, &QQuickText::textChanged,
- d, &QQuickLabelPrivate::_q_textChanged);
-}
-
-QQuickLabel::~QQuickLabel()
-{
-}
-
QQuickLabelPrivate::QQuickLabelPrivate()
: background(nullptr),
accessibleAttached(nullptr)
@@ -136,7 +123,7 @@ void QQuickLabelPrivate::inheritFont(const QFont &f)
emit q->fontChanged();
}
-void QQuickLabelPrivate::_q_textChanged(const QString &text)
+void QQuickLabelPrivate::textChanged(const QString &text)
{
#ifndef QT_NO_ACCESSIBILITY
if (accessibleAttached)
@@ -180,6 +167,13 @@ void QQuickLabelPrivate::deleteDelegate(QObject *delegate)
pendingDeletions.append(delegate);
}
+QQuickLabel::QQuickLabel(QQuickItem *parent)
+ : QQuickText(*(new QQuickLabelPrivate), parent)
+{
+ Q_D(QQuickLabel);
+ QObjectPrivate::connect(this, &QQuickText::textChanged, d, &QQuickLabelPrivate::textChanged);
+}
+
QFont QQuickLabel::font() const
{
return QQuickText::font();