aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlqt/data/createComponent.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlqt/data/createComponent.qml')
-rw-r--r--tests/auto/qml/qqmlqt/data/createComponent.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlqt/data/createComponent.qml b/tests/auto/qml/qqmlqt/data/createComponent.qml
index 3ebc9f14f8..01b6490419 100644
--- a/tests/auto/qml/qqmlqt/data/createComponent.qml
+++ b/tests/auto/qml/qqmlqt/data/createComponent.qml
@@ -9,6 +9,14 @@ QtObject {
property QtObject incorectArgCount1: Qt.createComponent()
property QtObject incorectArgCount2: Qt.createComponent("main.qml", 10)
+ property bool asyncResult: false
+ property var asyncComponent
+
+ function asyncStatusChanged() {
+ if (asyncComponent.status == Component.Ready)
+ asyncResult = true;
+ }
+
Component.onCompleted: {
emptyArg = (Qt.createComponent("") == null);
var r = Qt.createComponent("createComponentData.qml");
@@ -16,5 +24,10 @@ QtObject {
var a = Qt.createComponent("http://www.example.com/test.qml");
absoluteUrl = a.url;
+
+ asyncComponent = Qt.createComponent("TestComponent.qml", Component.Asynchronous);
+ if (asyncComponent.status != Component.Loading)
+ return;
+ asyncComponent.statusChanged.connect(asyncStatusChanged);
}
}