diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 8c59304303c538b8a18fe68eda2529d2f8dd7026..2375e494411aecec545c0078657dc339c95a59d1 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -109,6 +109,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value) setValue(newValue); m_isBound = false; emit valueChanged(name(), value); + emit valueChangedQml(); emit isBoundChanged(); } } @@ -121,7 +122,8 @@ void PropertyEditorValue::setValue(const QVariant &value) m_value = value; - emit valueChanged(QString(), value); + if (m_value.isValid()) + emit valueChangedQml(); emit isBoundChanged(); } @@ -156,7 +158,8 @@ bool PropertyEditorValue::isInSubState() const bool PropertyEditorValue::isBound() const { - return modelNode().isValid() && modelNode().property(name()).isValid() && modelNode().property(name()).isBindingProperty(); + const QmlDesigner::QmlObjectNode objectNode(modelNode()); + return objectNode.isValid() && objectNode.hasBindingProperty(name()); } bool PropertyEditorValue::isInModel() const @@ -206,8 +209,8 @@ PropertyEditorNodeWrapper* PropertyEditorValue::complexNode() void PropertyEditorValue::resetValue() { - if (m_value.isValid()) { - setValue(QVariant()); + if (m_value.isValid() || isBound()) { + m_value = QVariant(); m_isBound = false; emit valueChanged(name(), QVariant()); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h index 9a81e17f25e4bf665fb074aae6c1693a6bccfea1..1a6c42e872cdc275c2b66e523a5e618c1057e596 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h @@ -80,10 +80,10 @@ private: class PropertyEditorValue : public QObject { Q_OBJECT - Q_PROPERTY(QVariant value READ value WRITE setValueWithEmit NOTIFY valueChanged) + Q_PROPERTY(QVariant value READ value WRITE setValueWithEmit NOTIFY valueChangedQml) Q_PROPERTY(QString expression READ expression WRITE setExpressionWithEmit NOTIFY expressionChanged FINAL) - Q_PROPERTY(bool isInModel READ isInModel NOTIFY valueChanged FINAL) - Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChanged FINAL) + Q_PROPERTY(bool isInModel READ isInModel NOTIFY valueChangedQml FINAL) + Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChangedQml FINAL) Q_PROPERTY(bool isBound READ isBound NOTIFY isBoundChanged FINAL) Q_PROPERTY(bool isValid READ isValid NOTIFY isValid FINAL) Q_PROPERTY(QString name READ name FINAL) @@ -124,6 +124,7 @@ public slots: signals: void valueChanged(const QString &name, const QVariant&); + void valueChangedQml(); void expressionChanged(const QString &name);