diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-01-30 16:37:37 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-02-24 09:42:23 +0100 |
commit | a09ea6b3d6265a98c17e190db007fecfbd76f317 (patch) | |
tree | 5886c0877aa7b3b33e7685a2c043390be73e9a23 /src/qml/qml/qqmlglobal_p.h | |
parent | 499acf3114c973c5387331cab36a0b7038423cfd (diff) |
Avoid duplicate value type creation
We can actually produce an uninitialized but pre-allocated QVariant
using QVariant::Private. Using the new in-place construction support in
QMetaObject, we can minimize the amount of copying necessary for value
types.
Fixes: QTBUG-108789
Change-Id: I6b748794a6adbf6558e1e3086eab80fcfb3154a0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlglobal_p.h')
-rw-r--r-- | src/qml/qml/qqmlglobal_p.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index 918f95993f..e56ae73edc 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -189,12 +189,12 @@ inline void QQml_setParent_noEvent(QObject *object, QObject *parent) class QQmlValueTypeProvider { public: - static bool constructFromJSValue(const QJSValue &, QMetaType, void *); - - static bool createValueType(const QString &, QMetaType, void *); - static bool createValueType(const QJSValue &, QMetaType, void *); static bool createValueType(const QV4::Value &, QMetaType, void *); - static bool createValueType(const QVariant &, QMetaType, void *); + + static QVariant createValueType(const QJSValue &, QMetaType); + static QVariant createValueType(const QString &, QMetaType); + static QVariant createValueType(const QV4::Value &, QMetaType); + static QVariant createValueType(const QVariant &, QMetaType); }; class Q_QML_PRIVATE_EXPORT QQmlColorProvider |