aboutsummaryrefslogtreecommitdiffstats
path: root/src/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-18 09:25:50 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-03-18 09:25:50 +0100
commitefcc1a0b9ec1d10cfea5b8cde8f042dbe0b66fa8 (patch)
tree489084d4e73864798acea39f4e7199541b6f586f /src/controls
parent7f3a6848c09615bf4ed7d96ab80be6ca8707af54 (diff)
parentfec1a78618bae112ff8d1c0e6f078ea890cf283e (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/controls/qquickstyle.cpp src/controls/qquickstyleattached_p.h src/imports/controls/material/qquickmaterialstyle.cpp src/templates/qquickcontrol.cpp src/templates/qquickpopup.cpp Change-Id: I17c3c4d1040b89838f0903e0a17069b835895199
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/qquickstyleattached.cpp21
-rw-r--r--src/controls/qquickstyleattached_p.h2
2 files changed, 8 insertions, 15 deletions
diff --git a/src/controls/qquickstyleattached.cpp b/src/controls/qquickstyleattached.cpp
index 85a4b3c8..91ad6b10 100644
--- a/src/controls/qquickstyleattached.cpp
+++ b/src/controls/qquickstyleattached.cpp
@@ -147,14 +147,20 @@ static QList<QQuickStyleAttached *> findChildStyles(const QMetaObject *type, QOb
QQuickStyleAttached::QQuickStyleAttached(QObject *parent) : QObject(parent)
{
- QQuickItem *item = parentItem();
+ QQuickItem *item = qobject_cast<QQuickItem *>(parent);
+ if (!item) {
+ QQuickPopup *popup = qobject_cast<QQuickPopup *>(parent);
+ if (popup)
+ item = popup->popupItem();
+ }
+
if (item)
QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::Parent);
}
QQuickStyleAttached::~QQuickStyleAttached()
{
- QQuickItem *item = parentItem();
+ QQuickItem *item = qobject_cast<QQuickItem *>(parent());
if (item)
QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::Parent);
@@ -176,17 +182,6 @@ QSharedPointer<QSettings> QQuickStyleAttached::settings(const QString &group)
return QSharedPointer<QSettings>();
}
-QQuickItem *QQuickStyleAttached::parentItem() const
-{
- QQuickItem *item = qobject_cast<QQuickItem *>(parent());
- if (!item) {
- QQuickPopup *popup = qobject_cast<QQuickPopup *>(parent());
- if (popup)
- item = popup->popupItem();
- }
- return item;
-}
-
QList<QQuickStyleAttached *> QQuickStyleAttached::childStyles() const
{
return m_childStyles;
diff --git a/src/controls/qquickstyleattached_p.h b/src/controls/qquickstyleattached_p.h
index 591aa133..61e04bf6 100644
--- a/src/controls/qquickstyleattached_p.h
+++ b/src/controls/qquickstyleattached_p.h
@@ -73,8 +73,6 @@ public:
protected:
void init();
- QQuickItem *parentItem() const;
-
QList<QQuickStyleAttached *> childStyles() const;
QQuickStyleAttached *parentStyle() const;