diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-17 10:59:47 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-08-23 20:50:04 +0200 |
commit | 48b4c1f450109b148f03f62574d78b460859c4a1 (patch) | |
tree | bbd5f5f2e123444c28179e5886684535c8d09830 /src/qml/jsruntime/qv4engine.cpp | |
parent | f7100fbaaceb7c74b164a9130218a197454433cf (diff) |
Adapt to qtbase changes
The internal QVariant constructor taking a QMetaTypeId has been removed.
Thus, construct QMetaTypes where necessary from the id, or avoid a
QMetaType -> ID -> QMetaType roundtrip where we already have a metatype.
Also fix a few missing includse that were previously transitively
included.
Change-Id: I56ce92281d616108a4ff80fe5052b919d1282357
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 4d4013db48..f40fc3b780 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1568,7 +1568,7 @@ static QVariant toVariant(QV4::ExecutionEngine *e, const QV4::Value &value, int // the QVariant constructor will create a copy, so we have manually // destroy the value returned by QMetaType::create auto temp = QMetaType::create(typeHint); - retn = QVariant(typeHint, temp); + retn = QVariant(QMetaType(typeHint), temp); QMetaType::destroy(typeHint, temp); auto retnAsIterable = retn.value<QtMetaTypePrivate::QSequentialIterableImpl>(); if (retnAsIterable.containerCapabilities() & QtMetaTypePrivate::ContainerIsAppendable) { @@ -1596,7 +1596,7 @@ static QVariant toVariant(QV4::ExecutionEngine *e, const QV4::Value &value, int QString::fromUtf8(QMetaType::typeName(originalType)), QString::fromUtf8(QMetaType::typeName(retnAsIterable._metaType_id))); // create default constructed value - asVariant = QVariant(retnAsIterable._metaType_id, nullptr); + asVariant = QVariant(QMetaType(retnAsIterable._metaType_id), nullptr); } retnAsIterable.append(asVariant.constData()); } @@ -1913,7 +1913,7 @@ QV4::ReturnedValue ExecutionEngine::metaTypeToJS(int type, const void *data) { Q_ASSERT(data != nullptr); - QVariant variant(type, data); + QVariant variant(QMetaType(type), data); if (QMetaType::Type(variant.userType()) == QMetaType::QVariant) { // unwrap it: this is tested in QJSEngine, and makes the most sense for // end-user code too. |