summaryrefslogtreecommitdiffstats
path: root/src/controls/Private/Control.qml
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2015-09-17 10:50:48 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-09-17 11:01:08 +0000
commit3ed9cbc56fc8ea3cc92d1b8a2459103c85f39bbc (patch)
treebe8d9a80e411158ba36b920623710e3e052886cf /src/controls/Private/Control.qml
parent417fd8ae2e16cbf5d19a728354f2fea248d7f740 (diff)
Fix TypeErrors on control destruction with singleton style components
When destroying a control whose style points to a component defined in a QML singleton, there are errors about the parent of the panel being null. This patch moves the style loader out of the panel loader, which fixes the errors. However, as mentioned in the comments of the bug report, the destruction order seems to be unchanged, so it is unclear why this works. Change-Id: I4a9e33f2ddf6cfa0f069991367b87f91bec99410 Task-number: QTBUG-38422 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/Private/Control.qml')
-rw-r--r--src/controls/Private/Control.qml21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/controls/Private/Control.qml b/src/controls/Private/Control.qml
index f4733cc5f..4b965482e 100644
--- a/src/controls/Private/Control.qml
+++ b/src/controls/Private/Control.qml
@@ -72,19 +72,20 @@ FocusScope {
property alias __styleData: styleLoader.styleData
Loader {
+ id: styleLoader
+ sourceComponent: style
+ property Item __control: root
+ property QtObject styleData: null
+ onStatusChanged: {
+ if (status === Loader.Error)
+ console.error("Failed to load Style for", root)
+ }
+ }
+
+ Loader {
id: panelLoader
anchors.fill: parent
sourceComponent: __style ? __style.panel : null
onStatusChanged: if (status === Loader.Error) console.error("Failed to load Style for", root)
- Loader {
- id: styleLoader
- sourceComponent: style
- property Item __control: root
- property QtObject styleData: null
- onStatusChanged: {
- if (status === Loader.Error)
- console.error("Failed to load Style for", root)
- }
- }
}
}