aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/componentCreation.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/componentCreation.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/componentCreation.qml52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/componentCreation.qml b/tests/auto/qml/qqmlecmascript/data/componentCreation.qml
new file mode 100644
index 0000000000..d21301ea13
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/componentCreation.qml
@@ -0,0 +1,52 @@
+import Qt.test 1.0
+import QtQuick 2.0
+
+MyTypeObject{
+ id: obj
+ objectName: "obj"
+
+ function url()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml');
+ }
+
+ function urlMode()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', Component.PreferSynchronous);
+ }
+
+ function urlParent()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', obj);
+ }
+
+ function urlNullParent()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', null);
+ }
+
+ function urlModeParent()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', Component.PreferSynchronous, obj);
+ }
+
+ function urlModeNullParent()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', Component.PreferSynchronous, null);
+ }
+
+ function invalidSecondArg()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', 'Bad argument');
+ }
+
+ function invalidThirdArg()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', Component.PreferSynchronous, 'Bad argument');
+ }
+
+ function invalidMode()
+ {
+ obj.componentProperty = Qt.createComponent('dynamicCreation.helper.qml', -666);
+ }
+}