diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index bb80c2e2e1c..bd3994400ba 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -1221,7 +1221,15 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVecto if (instance.isValid()) { QVariant propertyValue = instance.property(propertyName); - if (QMetaType::isRegistered(propertyValue.userType()) && supportedVariantType(propertyValue.type())) { + bool isValid = QMetaType::isRegistered(propertyValue.userType()) + && supportedVariantType(propertyValue.type()); + if (!isValid && propertyValue.userType() == 0) { + // If the property is QVariant type, invalid variant can be a valid value + const QMetaObject *mo = instance.internalObject()->metaObject(); + const int idx = mo->indexOfProperty(propertyName); + isValid = idx >= 0 && mo->property(idx).userType() == QMetaType::QVariant; + } + if (isValid) { valueVector.append(PropertyValueContainer(instance.instanceId(), propertyName, propertyValue, PropertyName())); } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml index 4e2b1a2c1af..93a0878d377 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml @@ -76,13 +76,13 @@ StudioControls.TextField { id: colorLogic backendValue: lineEdit.backendValue onValueFromBackendChanged: { - if (colorLogic.valueFromBackend === undefined) - return - - if (writeValueManually) { - lineEdit.text = convertColorToString(colorLogic.valueFromBackend) + if (colorLogic.valueFromBackend === undefined) { + lineEdit.text = "" } else { - lineEdit.text = colorLogic.valueFromBackend + if (writeValueManually) + lineEdit.text = convertColorToString(colorLogic.valueFromBackend) + else + lineEdit.text = colorLogic.valueFromBackend } __dirty = false } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 6602cf36317..c37549e074a 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -167,7 +167,7 @@ void PropertyEditorValue::setValue(const QVariant &value) fixAmbigousColorNames(modelNode(), name(), &m_value); fixUrl(modelNode(), name(), &m_value); - if (m_value.isValid() && !colorsEqual) + if (!colorsEqual) emit valueChangedQml(); emit isExplicitChanged();