aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data/scopedEnum.qml
diff options
context:
space:
mode:
authorMichael Brasser <mbrasser@ford.com>2017-04-13 17:10:45 -0500
committerMichael Brasser <michael.brasser@live.com>2017-05-03 11:38:21 +0000
commitaae18aa05719c4b750905f467f42002f4cea1516 (patch)
tree167e75ae3aa157b47fccd75266ba40aa0325b63a /tests/auto/qml/qqmllanguage/data/scopedEnum.qml
parentf7656d06c0d2095a8d8dd3b930e48dc98996634f (diff)
C++11 scoped enum support for QML
[ChangeLog][QtQml] Support C++11 scoped enums in QML. These can now be accessed as <TypeName>.<EnumName>.<EnumValue> Change-Id: I29bd3f16e980f3e6f1b2390b5a8e9e8e999952a3 Task-number: QTBUG-54961 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data/scopedEnum.qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/scopedEnum.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/scopedEnum.qml b/tests/auto/qml/qqmllanguage/data/scopedEnum.qml
new file mode 100644
index 0000000000..7f4177af76
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/scopedEnum.qml
@@ -0,0 +1,21 @@
+import QtQuick 2.0
+import Test 1.0
+
+MyTypeObject {
+ id: obj
+ scopedEnum: MyTypeObject.MyScopedEnum.ScopedVal1
+ intProperty: MyTypeObject.MyScopedEnum.ScopedVal2
+ property int listValue: myModel.get(0).myData
+ property int noScope: MyTypeObject.ScopedVal1
+
+ function assignNewValue() {
+ scopedEnum = MyTypeObject.MyScopedEnum.ScopedVal2
+ noScope = MyTypeObject.ScopedVal2
+ }
+
+ property ListModel myModel: ListModel {
+ ListElement {
+ myData: MyTypeObject.MyScopedEnum.ScopedVal3
+ }
+ }
+}