summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlqt/data/createComponent.qml
blob: 57f50d8f109094a346c3e2f8c5d450fc95b1c4dd (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

Object {
    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;
    }
}