Use V4 binding for non-final properties where possible
[profile/ivi/qtdeclarative.git] / tests / auto / qml / qqmlecmascript / data / enums.2.qml
1 import Qt.test 1.0
2 import Qt.test 1.0 as Namespace
3
4 MyQmlObject {
5     id: root
6
7     property int a: MyQmlObject.EnumValue10
8     property int b: Namespace.MyQmlObject.EnumValue10
9     property int c: child.enumProperty
10
11     // test binding codepath
12     property MyUnregisteredEnumTypeObject child: MyUnregisteredEnumTypeObject {
13         enumProperty: undefined
14     }
15
16     // test assignment codepaths
17     function testAssignmentOne() {
18         child.enumProperty = function() { return "Hello, world!" };   // cannot assign function to non-var prop.
19     }
20     function testAssignmentTwo() {
21         child.enumProperty = MyUnregisteredEnumTypeObject.Firstvalue; // note: incorrect capitalisation
22     }
23     function testAssignmentThree() {
24         child.enumProperty = undefined;                               // directly set undefined value
25     }
26
27
28
29     property int d: 5
30     property MyUnregisteredEnumTypeObject child2: MyUnregisteredEnumTypeObject {
31         enumProperty: root.d
32     }
33     function testAssignmentFour() {
34         child2.enumProperty = root.d;
35     }
36 }
37