diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-07-05 12:27:17 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-07-05 15:09:50 +0200 |
commit | cd8e839e032f31a7421f33fd65dc3eaba4d84052 (patch) | |
tree | 9921b19860d54857bc1b46d9d6c1407f44976542 | |
parent | 930da44767dcd0ccb50aaf725e3cbac99eaf13ea (diff) |
QJSValue: Avoid BIC break
The toScriptValue function template called the exported create function.
Thus, we can not change the signature of create, even though it was
private. To avoid the BIC break, we keep the old version (and ifdef it
so that it will go away in Qt 7).
Task-number: QTBUG-94407
Pick-to: 6.2
Change-Id: I5b07f978dca156f52bdb529d3e15aea8c0c3c97e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/qml/jsapi/qjsengine.cpp | 8 | ||||
-rw-r--r-- | src/qml/jsapi/qjsengine.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index e7d784ef29..f67cff054c 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -838,6 +838,14 @@ QJSValue QJSEngine::create(QMetaType type, const void *ptr) return QJSValuePrivate::fromReturnedValue(v->asReturnedValue()); } +#if QT_VERSION < QT_VERSION_CHECK(7,0,0) +QJSValue QJSEngine::create(int typeId, const void *ptr) +{ + QMetaType type(typeId); + return create(type, ptr); +} +#endif + bool QJSEngine::convertManaged(const QJSManagedValue &value, int type, void *ptr) { return convertManaged(value, QMetaType(type), ptr); diff --git a/src/qml/jsapi/qjsengine.h b/src/qml/jsapi/qjsengine.h index 84730afe2b..23578a63b6 100644 --- a/src/qml/jsapi/qjsengine.h +++ b/src/qml/jsapi/qjsengine.h @@ -149,6 +149,9 @@ Q_SIGNALS: private: QJSManagedValue createManaged(QMetaType type, const void *ptr); QJSValue create(QMetaType type, const void *ptr); +#if QT_VERSION < QT_VERSION_CHECK(7,0,0) + QJSValue create(int id, const void *ptr); // only there for BC reasons +#endif static bool convertManaged(const QJSManagedValue &value, int type, void *ptr); static bool convertManaged(const QJSManagedValue &value, QMetaType type, void *ptr); |