summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml
blob: 7b132e1edf0d5d2b0aa79b4f2c697d3d77f8af03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import Qt.test 1.0

MyQmlObject{
    id: obj
    objectName: "obj"
    function createOne()
    {
        obj.objectProperty = Qt.createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"objectOne"}', obj);
    }

    function createTwo()
    {
        var component = Qt.createComponent('dynamicCreation.helper.qml');
        obj.objectProperty = component.createObject(obj);
    }

    function createThree()
    {
        obj.objectProperty = Qt.createQmlObject('TypeForDynamicCreation{}', obj);
    }

    function dontCrash()
    {
        var component = Qt.createComponent('file-doesnt-exist.qml');
        obj.objectProperty = component.createObject(obj);
    }
}