diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-21 10:40:27 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-02 13:21:09 +0200 |
commit | 45594322fe91eadcd9b2d7b1d76c1a6662bc1472 (patch) | |
tree | d14e743f40351ca7a660984616b2500aa83032f5 /src/qml/qml/qqmlobjectcreator.cpp | |
parent | d621027babff9a30d56ab6af871a465108c9eaba (diff) |
Use factory functions and ctors for creating value types
As you can extend value types with QML_EXTENDED we may as well allow a
factory function in the extended type. Furthermore, if the original type
allows construction from QJSValue, we may just use that. In turn, we can
get rid of the value type providers now.
Change-Id: I9124ea47537eab6c33d7451080ab2fff942eaa7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index dc25aa9f0a..45c9400934 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -485,7 +485,7 @@ void QQmlObjectCreator::setPropertyValue(const QQmlPropertyData *property, const case QMetaType::QColor: { QVariant data; if (QQml_valueTypeProvider()->createValueType( - QMetaType::QColor, compilationUnit->bindingValueAsString(binding), &data)) { + QMetaType::QColor, compilationUnit->bindingValueAsString(binding), data)) { property->writeProperty(_qobject, data.data(), propertyWriteFlags); } } @@ -568,7 +568,7 @@ void QQmlObjectCreator::setPropertyValue(const QQmlPropertyData *property, const case QMetaType::QQuaternion: { QVariant result; bool ok = QQml_valueTypeProvider()->createValueType( - propertyType, compilationUnit->bindingValueAsString(binding), &result); + propertyType, compilationUnit->bindingValueAsString(binding), result); assertOrNull(ok); Q_UNUSED(ok); property->writeProperty(_qobject, result.data(), propertyWriteFlags); |