summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
blob: d9b70ec671d55cab697c1f93a418572e02365372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Qt 4.6

QtObject {
    property bool incorrectArgCount1: false
    property bool incorrectArgCount2: false
    property bool emptyArg: false

    property string relativeUrl
    property string absoluteUrl

    Component.onCompleted: {
        // Test that using incorrect argument count returns a null object
        incorrectArgCount1 = (createComponent() == null);
        incorrectArgCount2 = (createComponent("main.qml", 10) == null);
        emptyArg = (createComponent("") == null);

        var r = createComponent("createComponentData.qml");
        relativeUrl = r.url;

        var a = createComponent("http://www.example.com/test.qml");
        absoluteUrl = a.url;
    }
}