aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/controls/qquicktheme.cpp4
-rw-r--r--tests/auto/theme/data/tst_theme.qml18
2 files changed, 20 insertions, 2 deletions
diff --git a/src/imports/controls/qquicktheme.cpp b/src/imports/controls/qquicktheme.cpp
index f0345df2..923d452b 100644
--- a/src/imports/controls/qquicktheme.cpp
+++ b/src/imports/controls/qquicktheme.cpp
@@ -344,11 +344,11 @@ const QQuickThemeData &QQuickThemeAttachedPrivate::resolve() const
return theme ? theme->d_func()->data : *globalThemeData();
}
-void QQuickThemeAttachedPrivate::itemParentChanged(QQuickItem *item, QQuickItem *)
+void QQuickThemeAttachedPrivate::itemParentChanged(QQuickItem *item, QQuickItem *parentItem)
{
QQuickThemeAttached *theme = QQuickStyle::instance<QQuickThemeAttached>(item);
if (theme) {
- QQuickThemeAttached *parent = QQuickStyle::findParent<QQuickThemeAttached>(theme);
+ QQuickThemeAttached *parent = QQuickStyle::findParent<QQuickThemeAttached>(parentItem);
if (parent)
theme->setParentTheme(parent);
}
diff --git a/tests/auto/theme/data/tst_theme.qml b/tests/auto/theme/data/tst_theme.qml
index 4f94f2f5..03c19fc6 100644
--- a/tests/auto/theme/data/tst_theme.qml
+++ b/tests/auto/theme/data/tst_theme.qml
@@ -101,6 +101,14 @@ TestCase {
}
}
+ Component {
+ id: swipeView
+ SwipeView {
+ Theme.accentColor: "#111111"
+ Button { }
+ }
+ }
+
function test_defaults() {
var control = button.createObject(testCase)
verify(control)
@@ -274,4 +282,14 @@ TestCase {
compare(control.item.Theme.accentColor, "#333333")
control.destroy()
}
+
+ function test_swipeView() {
+ var control = swipeView.createObject(testCase)
+ verify(control)
+ var child = control.itemAt(0)
+ verify(child)
+ compare(control.Theme.accentColor, "#111111")
+ compare(child.Theme.accentColor, "#111111")
+ control.destroy()
+ }
}