aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/quicktemplates2/qquicklabel.cpp22
-rw-r--r--src/quicktemplates2/qquicklabel_p.h1
-rw-r--r--src/quicktemplates2/qquicklabel_p_p.h9
3 files changed, 13 insertions, 19 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();
diff --git a/src/quicktemplates2/qquicklabel_p.h b/src/quicktemplates2/qquicklabel_p.h
index 29b1e7db..04172900 100644
--- a/src/quicktemplates2/qquicklabel_p.h
+++ b/src/quicktemplates2/qquicklabel_p.h
@@ -63,7 +63,6 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickLabel : public QQuickText
public:
explicit QQuickLabel(QQuickItem *parent = nullptr);
- ~QQuickLabel();
QFont font() const;
void setFont(const QFont &font);
diff --git a/src/quicktemplates2/qquicklabel_p_p.h b/src/quicktemplates2/qquicklabel_p_p.h
index 5b07a85f..9bc7c36d 100644
--- a/src/quicktemplates2/qquicklabel_p_p.h
+++ b/src/quicktemplates2/qquicklabel_p_p.h
@@ -69,14 +69,15 @@ public:
QQuickLabelPrivate();
~QQuickLabelPrivate();
- static QQuickLabelPrivate *get(QQuickLabel *item) {
- return static_cast<QQuickLabelPrivate *>(QObjectPrivate::get(item)); }
+ static QQuickLabelPrivate *get(QQuickLabel *item)
+ {
+ return static_cast<QQuickLabelPrivate *>(QObjectPrivate::get(item));
+ }
- void resizeBackground();
void resolveFont();
void inheritFont(const QFont &f);
- void _q_textChanged(const QString &text);
+ void textChanged(const QString &text);
#ifndef QT_NO_ACCESSIBILITY
void accessibilityActiveChanged(bool active) override;