diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-01 12:54:23 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-08 22:37:35 +0200 |
commit | 062843124470e90ada7323b0734ff35addb0a9cb (patch) | |
tree | bdc29b0ff44a03abf3b4e55f5b17f9def7d18d13 /src/qml/qml/qqmlglobal_p.h | |
parent | 9136e5748b72e68613d7c3644a739dba36cdea34 (diff) |
Qml: Construct value types by properties from any object-likes
Since we allow any object to be used for property-by-property
construction when encoded as QJSValue, we should do the same when it's
encoded as QVariant.
This allows us to use typed modelData in delegates. The modelData's type
only has to be a structured value. Any matching data from the model will
then be inserted.
Fixes: QTBUG-113752
Pick-to: 6.5 6.6
Change-Id: I200e9acac3c6c302c9dedf8e7e1ccd6c9fdf5eb6
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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index 172ae28e8c..bd2cfc9a06 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -204,9 +204,9 @@ inline void QQml_setParent_noEvent(QObject *object, QObject *parent) class QQmlValueTypeProvider { public: - static bool createValueType(const QV4::Value &, QMetaType, void *); + static bool createValueType(QMetaType targetMetaType, void *target, const QV4::Value &source); static QVariant constructValueType( - QMetaType resultMetaType, const QMetaObject *resultMetaObject, + QMetaType targetMetaType, const QMetaObject *targetMetaObject, int ctorIndex, void *ctorArg); static QVariant createValueType(const QJSValue &, QMetaType); |