aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml
diff options
context:
space:
mode:
authorMichael Brasser <mbrasser@ford.com>2017-08-17 18:24:39 -0500
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-18 18:03:34 +0000
commitcf1dcc857a5b9fdc55f21508c812bb4110cf93b7 (patch)
tree81ad9ad112de838786e2450fe72fc97bf23b9674 /tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml
parentad63e8491bdf6e85af1a72a44ef643321e6ceec0 (diff)
Support explicit enum value declaration in QML
Allow declarations such as: enum MyEnum { Value1 = 1, Value2 } Not all features of C++ enums are supported. Specifically, we don't yet allow: * Negative numbers (Value1 = -1) * Assignment of other values (Value2 = Value1) Change-Id: I4776f8d86bd0c8688c7dd8b7d4ccb2f72fdfe721 Task-number: QTBUG-14861 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml b/tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml
index c89a228bef..c6788f787a 100644
--- a/tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml
+++ b/tests/auto/qml/qqmllanguage/data/TypeWithEnum.qml
@@ -7,8 +7,22 @@ QtObject {
EnumValue3
}
+ enum MyOtherEnum {
+ OtherEnumValue1 = 24,
+ OtherEnumValue2,
+ OtherEnumValue3 = 24,
+ OtherEnumValue4,
+ OtherEnumValue5 = 1
+ }
+
property int enumValue: TypeWithEnum.EnumValue2
property int enumValue2
property int scopedEnumValue: TypeWithEnum.MyEnum.EnumValue2
Component.onCompleted: enumValue2 = TypeWithEnum.EnumValue3
+
+ property int otherEnumValue1: TypeWithEnum.OtherEnumValue1
+ property int otherEnumValue2: TypeWithEnum.OtherEnumValue2
+ property int otherEnumValue3: TypeWithEnum.OtherEnumValue3
+ property int otherEnumValue4: TypeWithEnum.OtherEnumValue4
+ property int otherEnumValue5: TypeWithEnum.OtherEnumValue5
}