blob: 54a3e7d344f3c794767616ee1cb5be6939dcb753 (
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
28
29
30
31
|
import Qt 4.6
Item {
id: root
property bool incorrectArgCount1: false
property bool incorrectArgCount2: false
property bool emptyArg: false
property bool noParent: false
property bool notAvailable: false
property bool runtimeError: false
property bool errors: false
property bool success: false
Component.onCompleted: {
// errors
incorrectArgCount1 = (createQmlObject() == null);
incorrectArgCount2 = (createQmlObject("import Qt 4.6\nQtObject{}", root, "main.qml", 10) == null);
emptyArg = (createQmlObject("", root) == null);
errors = (createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\nproperty int test: 13\n}", root, "main.qml") == null);
noParent = (createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13}", 0) == null);
notAvailable = (createQmlObject("import Qt 4.6\nQtObject{Blah{}}", root) == null);
runtimeError = (createQmlObject("import Qt 4.6\nQtObject{property int test\nonTestChanged: QtObject{}\n}", root) == null);
var o = createQmlObject("import Qt 4.6\nQtObject{\nproperty int test: 13\n}", root);
success = (o.test == 13);
createQmlObject("import Qt 4.6\nItem {}\n", root);
}
}
|