diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-03-06 18:03:33 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-15 10:14:37 +0100 |
commit | 31467e8649979d06ea2f676768016e6a147eadb9 (patch) | |
tree | b318865886c33aa266141870972adc03900522e0 /tests/auto/qml/qqmlqt/data/createComponent.2.qml | |
parent | b634c19680cd1d4dd925a18e616844ed420d18ae (diff) |
Allow threaded compilation in an async Loader
Enables threaded compilation for a Loader "source".
Change-Id: I2d60a3ace07aab58f3b8f069e45a2864178c959f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlqt/data/createComponent.2.qml')
-rw-r--r-- | tests/auto/qml/qqmlqt/data/createComponent.2.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlqt/data/createComponent.2.qml b/tests/auto/qml/qqmlqt/data/createComponent.2.qml new file mode 100644 index 0000000000..36e2b23c9f --- /dev/null +++ b/tests/auto/qml/qqmlqt/data/createComponent.2.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Item { + property bool success: false + property var syncComponent + property var asyncComponent + + function asyncStatusChanged() { + if (asyncComponent.status == Component.Ready && syncComponent.status == Component.Ready) { + success = true; + var ao = asyncComponent.createObject(); + var so = syncComponent.createObject(); + if (ao.c1one != 6) success = false; + if (so.c1one != 55) success = false; + ao.destroy(); + so.destroy(); + } + } + + Component.onCompleted: { + asyncComponent = Qt.createComponent("TestComponent.2.qml", Component.Asynchronous); + if (asyncComponent.status != Component.Loading) + return; + asyncComponent.statusChanged.connect(asyncStatusChanged); + syncComponent = Qt.createComponent("TestComponent.3.qml", Component.PreferSynchronous); + } +} |