aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-02 08:48:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-02 23:36:58 +0100
commiteb3087e4b0b770200512925730c328a8bda7f3d7 (patch)
treef4511cfbf095be316d8a961a2242adcfa88f086f /tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml
parentc988a8e450c6aea6e9588e1517c5bab1acff2a62 (diff)
Fix lookups of enums in singletons
This is a regression against 5.2.0 (which didn't have this bug), due to optimizations introduced in the stable branch after the release. The code path for optimizing access to the members of C++ based singletons through the regular meta-object properties would end up excluding access to enums when the lookup happens at run-time. The run-time getter for the singleton itself would return a wrapped QObject instead of a QQmlTypeWrapper, and only the latter includes enums. As QML based singletons (composite singletons) cannot declare enums, we can continue to do fast lookups on these, but otherwise have to fall back to the slower code path. Task-number: QTBUG-35721 Change-Id: Icc66bdaf3572622cdb718f82b706e3204afa0167 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml b/tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml
new file mode 100644
index 0000000000..166f823667
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/singletontype/singletonWithEnum.qml
@@ -0,0 +1,9 @@
+import QtQml 2.0
+import Qt.test.singletonWithEnum 1.0
+
+QtObject {
+ property int testValue: 0
+ Component.onCompleted: {
+ testValue = SingletonWithEnum.TestValue;
+ }
+}