blob: 3047e9b4034f8f0e24a26571a39c8d69dd308185 (
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();
}
function createThree()
{
obj.objectProperty = Qt.createQmlObject('TypeForDynamicCreation{}', obj);
}
function dontCrash()
{
var component = Qt.createComponent('file-doesnt-exist.qml');
obj.objectProperty = component.createObject();
}
}
|