aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/dynamicCreation.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/dynamicCreation.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/dynamicCreation.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/dynamicCreation.qml b/tests/auto/qml/qqmlecmascript/data/dynamicCreation.qml
new file mode 100644
index 0000000000..7b132e1edf
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/dynamicCreation.qml
@@ -0,0 +1,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);
+ }
+}