Debian Codegraph @

tests/auto/qml/qqmlqt/data/createComponent.qml

raw
1 import QtQuick 2.0
2
3 QtObject {
4 property bool emptyArg: false
5
6 property string relativeUrl
7 property string absoluteUrl
8
9 property QtObject incorectArgCount1: Qt.createComponent()
10 property QtObject incorectArgCount2: Qt.createComponent("main.qml", 10)
11
12 property bool asyncResult: false
13 property var asyncComponent
14
15 function asyncStatusChanged() {
16 if (asyncComponent.status == Component.Ready)
17 asyncResult = true;
18 }
19
20 Component.onCompleted: {
21 emptyArg = (Qt.createComponent("") == null);
22 var r = Qt.createComponent("createComponentData.qml");
23 relativeUrl = r.url;
24
25 var a = Qt.createComponent("http://www.example.com/test.qml");
26 absoluteUrl = a.url;
27
28 asyncComponent = Qt.createComponent("TestComponent.qml", Component.Asynchronous);
29 if (asyncComponent.status != Component.Loading)
30 return;
31 asyncComponent.statusChanged.connect(asyncStatusChanged);
32 }
33 }