aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compat
diff options
context:
space:
mode:
authorFabian Kosmale <[email protected]>2023-10-31 16:14:13 +0100
committerFabian Kosmale <[email protected]>2023-11-01 21:30:45 +0100
commit34c4f8aa9ff90d6f614d0726ebf667ba0f435274 (patch)
tree772cf3f77a11dbf282fea81679016bf742bbfa00 /src/qml/compat
parent25828716396ce8babfdb11f6ef887c86f5659f73 (diff)
qqmlprivate.h: Fix BC issue
The old function might still be callde from code compiled against Qt < 6.6. Fix this by providing the old overload in removde_api: It is implemented by calling the new overload, and then converting the result to an int. Amends f10630aa035ae1ef4ad75be1107ab77fea0c7e29. Pick-to: 6.6 Change-Id: I373460af2a66c069bfc0b57a9bb169d705d2a6b9 Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/qml/compat')
-rw-r--r--src/qml/compat/removed_api.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qml/compat/removed_api.cpp b/src/qml/compat/removed_api.cpp
index 00c899d73c..fe16b7f462 100644
--- a/src/qml/compat/removed_api.cpp
+++ b/src/qml/compat/removed_api.cpp
@@ -24,3 +24,19 @@ bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr)
#endif
+#if QT_QML_REMOVED_SINCE(6, 6)
+#include <QtQml/qqmlprivate.h>
+#include <QtQml/private/qv4executablecompilationunit_p.h>
+#include <QtQml/private/qv4lookup_p.h>
+
+bool QQmlPrivate::AOTCompiledContext::getEnumLookup(uint index, int *target) const
+{
+ using namespace QQmlPrivate;
+ QV4::Lookup *l = compilationUnit->runtimeLookups + index;
+ auto mt = QMetaType(l->qmlEnumValueLookup.metaType);
+ QVariant buffer(mt);
+ getEnumLookup(index, buffer.data());
+ *target = buffer.toInt();
+ return true;
+}
+#endif