From ee89a8c052db0fa3dffe3e01c4c0309cf9ec80d0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 16 Mar 2018 11:15:38 +0100 Subject: Fix lookup of enums declared in QML singletons Given the following expression var x = MySingleton.MyEnumValue where MySingleton is a QML (composite) singleton and MyEnumValue comes from a QML declared enum, we had code in place up to (and including) 5.10 to attempt to optimize that expression to a enum constant at compile time. In 5.10 that optimization does not exist anymore. In <= 5.10 we would also skip the optimization under certain circumstances (too many statementes, etc.). The fallback that is in place for handling this at run-time tried to be smart by avoiding the QQmlContextWrapper::get lookup and return straight a reference to the singleton as QObject. That works for regular property lookups, but it fails when trying to look up something like an enum, that isn't a meta-object property. Change-Id: I1819b9d8ae06a3f595e067bf5b018c4065be76bb Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4engine_p.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/qml/jsruntime/qv4engine_p.h') diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 5edf89f720..c7fb743088 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -441,7 +441,6 @@ public: Heap::QmlContext *qmlContext() const; QObject *qmlScopeObject() const; - ReturnedValue qmlSingletonWrapper(String *name); QQmlContextData *callingQmlContext() const; -- cgit v1.2.3