diff options
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 310f8579bf..809d1c4976 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -483,12 +483,10 @@ void QQmlObjectCreator::setPropertyValue(const QQmlPropertyData *property, const } break; case QMetaType::QColor: { - bool ok = false; - uint colorValue = QQmlStringConverters::rgbaFromString(compilationUnit->bindingValueAsString(binding), &ok); - assertOrNull(ok); - struct { void *data[4]; } buffer; - if (QQml_valueTypeProvider()->storeValueType(property->propType(), &colorValue, &buffer, sizeof(buffer))) { - property->writeProperty(_qobject, &buffer, propertyWriteFlags); + QVariant data; + if (QQml_valueTypeProvider()->createValueFromString( + QMetaType::QColor, compilationUnit->bindingValueAsString(binding), &data)) { + property->writeProperty(_qobject, data.data(), propertyWriteFlags); } } break; |