diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index d1a0fca48eebeb4ef1721309c0915e14d451dbfa..c429b1c808432810846197d3eec1fb1a58720558 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -295,10 +295,31 @@ void PropertyEditor::anyPropertyChanged(const QmlObjectNode &fxObjectNode) } } +void PropertyEditor::geometryPropertyChanged(const QmlObjectNode &fxObjectNode) +{ + if (fxObjectNode.isValid() && m_currentType && fxObjectNode == m_selectedNode && fxObjectNode.currentState().isValid()) { + QStringList geometryProperties; + geometryProperties << "x" << "y" << "width" << "height" << "rotation" << "scale"; + foreach (const QString &propertyName, geometryProperties) { + if ( propertyName != "id" && propertyName != "objectName") { + AbstractProperty property = fxObjectNode.modelNode().property(propertyName); + if (fxObjectNode == m_selectedNode || QmlObjectNode(m_selectedNode).propertyChangeForCurrentState() == fxObjectNode) { + if ( m_selectedNode.property(property.name()).isBindingProperty() || !m_selectedNode.hasProperty(propertyName)) + m_currentType->setValue(m_selectedNode, property.name(), QmlObjectNode(m_selectedNode).instanceValue(property.name())); + else + m_currentType->setValue(m_selectedNode, property.name(), QmlObjectNode(m_selectedNode).modelValue(property.name())); + } + } + } + } +} + void PropertyEditor::otherPropertyChanged(const QmlObjectNode &fxObjectNode) { QmlModelView::otherPropertyChanged(fxObjectNode); + return ; + anyPropertyChanged(fxObjectNode); } @@ -307,6 +328,8 @@ void PropertyEditor::transformChanged(const QmlObjectNode &fxObjectNode) QmlModelView::transformChanged(fxObjectNode); anyPropertyChanged(fxObjectNode); + return ; + } void PropertyEditor::setQmlDir(const QString &qmlDir) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h index 9fff376df6da8574a217ceb2842ba114e0a5f53b..8898984c7d2433d2f07f64d6383e54b5be707c3a 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h @@ -84,6 +84,7 @@ public: void anyPropertyChanged(const QmlObjectNode &qmlObjectNode); + void geometryPropertyChanged(const QmlObjectNode &fxObjectNode);