diff options
author | Thomas Hartmann <Thomas.Hartmann@qt.io> | 2021-10-01 17:00:17 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2021-10-05 08:30:28 +0000 |
commit | bc7f52c475eed7c5c9e4974c0c0cb4d02b754ce9 (patch) | |
tree | b5ae7c23cfd88635b1c8ec4a53a6c8ddcc03095c | |
parent | 068c4e9b7b9de9cac4136f613fdfa7b8e9020d3b (diff) |
QmlDesigner: Remove x,y when setting center anchors
Change-Id: Id6cde717f8a6fe66ac78c65e2e1ac387ec6d3c1d
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r-- | src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp index aecab7c42c..2664f2c7a9 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp @@ -861,6 +861,7 @@ void QmlAnchorBindingProxy::anchorVertical() m_qmlItemNode.anchors().setAnchor(AnchorLineVerticalCenter, m_verticalTarget, AnchorLineVerticalCenter); } + backupPropertyAndRemove(modelNode(), "y"); m_locked = false; } @@ -874,6 +875,7 @@ void QmlAnchorBindingProxy::anchorHorizontal() } else if (m_relativeVerticalTarget == Center) { m_qmlItemNode.anchors().setAnchor(AnchorLineHorizontalCenter, m_horizontalTarget, AnchorLineHorizontalCenter); } + backupPropertyAndRemove(modelNode(), "x"); m_locked = false; } @@ -993,6 +995,7 @@ void QmlAnchorBindingProxy::setVerticalCentered(bool centered) if (!centered) { m_qmlItemNode.anchors().removeAnchor(AnchorLineVerticalCenter); m_qmlItemNode.anchors().removeMargin(AnchorLineVerticalCenter); + restoreProperty(m_qmlItemNode, "y"); } else { m_relativeVerticalTarget = Center; @@ -1020,6 +1023,7 @@ void QmlAnchorBindingProxy::setHorizontalCentered(bool centered) if (!centered) { m_qmlItemNode.anchors().removeAnchor(AnchorLineHorizontalCenter); m_qmlItemNode.anchors().removeMargin(AnchorLineHorizontalCenter); + restoreProperty(m_qmlItemNode, "x"); } else { m_relativeHorizontalTarget = Center; |