summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeqt/data/createComponent.qml')
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent.qml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
new file mode 100644
index 0000000..d9b70ec
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent.qml
@@ -0,0 +1,23 @@
+import Qt 4.6
+
+QtObject {
+ 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;
+ }
+}