From bb6bc1a06d0348b6b92c39f40e5f8cb1e2fcf67f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 31 Jan 2023 09:34:26 +0100 Subject: [PATCH] QJSEngine: Move old convertV2 to removed_api.cpp Pick-to: 6.5 Change-Id: I7f700d64694c8651769841a0109d32e8f9a839b2 Reviewed-by: Fabian Kosmale --- src/qml/compat/removed_api.cpp | 5 +++++ src/qml/jsapi/qjsengine.cpp | 7 ------- src/qml/jsapi/qjsengine.h | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/qml/compat/removed_api.cpp b/src/qml/compat/removed_api.cpp index acdd0bab13..00c899d73c 100644 --- a/src/qml/compat/removed_api.cpp +++ b/src/qml/compat/removed_api.cpp @@ -17,5 +17,10 @@ QJSValue QJSEngine::create(int typeId, const void *ptr) return create(type, ptr); } +bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr) +{ + return convertV2(value, QMetaType(type), ptr); +} + #endif diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index 04edd7a684..d3a6ed7391 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -848,13 +848,6 @@ bool QJSEngine::convertManaged(const QJSManagedValue &value, QMetaType type, voi return QV4::ExecutionEngine::metaTypeFromJS(*value.d, type, ptr); } -#if QT_VERSION < QT_VERSION_CHECK(7,0,0) -bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr) -{ - return convertV2(value, QMetaType(type), ptr); -} -#endif - bool QJSEngine::convertString(const QString &string, QMetaType metaType, void *ptr) { // have a string based value without engine. Do conversion manually diff --git a/src/qml/jsapi/qjsengine.h b/src/qml/jsapi/qjsengine.h index 9fb56f8cb8..c04e47d34e 100644 --- a/src/qml/jsapi/qjsengine.h +++ b/src/qml/jsapi/qjsengine.h @@ -305,7 +305,7 @@ private: static bool convertPrimitive(const QJSPrimitiveValue &value, QMetaType type, void *ptr); static bool convertManaged(const QJSManagedValue &value, int type, void *ptr); static bool convertManaged(const QJSManagedValue &value, QMetaType type, void *ptr); -#if QT_VERSION < QT_VERSION_CHECK(7,0,0) +#if QT_QML_REMOVED_SINCE(6, 5) static bool convertV2(const QJSValue &value, int type, void *ptr); // only there for BC reasons #endif static bool convertV2(const QJSValue &value, QMetaType metaType, void *ptr);