diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-21 14:08:12 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-23 21:22:58 +0200 |
commit | 8889089d0fd8ab93f623a98992588087e45399a5 (patch) | |
tree | f5f99110badcf61ed4a09b68eb86c87eaca803c4 /src/qml/qml/qqmlglobal_p.h | |
parent | a850b68d918d57d919168649e8bbaa97489f3026 (diff) |
QtQml: Further refine value type creation methods
The methods that populate a default-constructed value type
should be called "populateValueType" and they don't have to
unconditionally destroy the old value.
Change-Id: Icbc0b4bccf00bb9d0f6c838239ac23a1ec9367aa
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 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index ce18cfb1e1..bed5bd10b1 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -16,8 +16,9 @@ // #include <private/qmetaobject_p.h> -#include <private/qtqmlglobal_p.h> #include <private/qqmlmetaobject_p.h> +#include <private/qqmltype_p.h> +#include <private/qtqmlglobal_p.h> #include <QtQml/qqml.h> #include <QtCore/qobject.h> @@ -205,10 +206,13 @@ inline void QQml_setParent_noEvent(QObject *object, QObject *parent) class QQmlValueTypeProvider { public: - static bool createValueType(QMetaType targetMetaType, void *target, const QV4::Value &source); - static bool createValueType( - QMetaType targetMetaType, void *target, QMetaType sourceMetaType, void *source); + static bool populateValueType( + QMetaType targetMetaType, void *target, const QV4::Value &source); + static bool populateValueType( + QMetaType targetMetaType, void *target, QMetaType sourceMetaType, void *source); + static Q_QML_PRIVATE_EXPORT void *heapCreateValueType( + const QQmlType &targetType, const QV4::Value &source); static QVariant constructValueType( QMetaType targetMetaType, const QMetaObject *targetMetaObject, int ctorIndex, void *ctorArg); |