aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/data/globalEnums.qml
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-03-15 11:58:58 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-21 01:10:41 +0100
commit37cd29b2ff024f27f84ef6214ff5403603d522f2 (patch)
tree88dd0d32f024195ed068dd87663e3b07bb6d798b /tests/auto/qml/qqmllanguage/data/globalEnums.qml
parentfd8028514550da7594736a10f1d20bab1576bcfd (diff)
Support (registered) non-local enums for signal/slot params in QML.
It's now possible to detect whether a registered type is an enum, allowing registered non-local enums to be used as parameters in signals and slots from QML/C++. Author: Glenn Watson <glenn.watson@nokia.com> Task-number: QTBUG-20639 Change-Id: I8c439f2dcc7bfd8ec31914b0c86cd3a1de3c038c Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/data/globalEnums.qml')
-rw-r--r--tests/auto/qml/qqmllanguage/data/globalEnums.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/globalEnums.qml b/tests/auto/qml/qqmllanguage/data/globalEnums.qml
new file mode 100644
index 0000000000..102102a6c0
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/globalEnums.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+import Test 1.0
+
+Item {
+ MyEnum1Class {
+ id: enum1Class
+ objectName: "enum1Class"
+ }
+
+ MyEnumDerivedClass {
+ id: enumDerivedClass
+ objectName: "enumDerivedClass"
+
+ onValueAChanged: {
+ aValue = newValue;
+ }
+
+ onValueBChanged: {
+ bValue = newValue;
+ }
+
+ property int aValue: 0
+ property int bValue: 0
+ }
+
+ function setEnumValues() {
+ enum1Class.setValue(MyEnum1Class.A_13);
+ enumDerivedClass.setValueA(MyEnum1Class.A_11);
+ enumDerivedClass.setValueB(MyEnum2Class.B_37);
+ }
+}