aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@qt.io>2021-10-01 17:00:17 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2021-10-05 08:30:28 +0000
commitbc7f52c475eed7c5c9e4974c0c0cb4d02b754ce9 (patch)
treeb5ae7c23cfd88635b1c8ec4a53a6c8ddcc03095c
parent068c4e9b7b9de9cac4136f613fdfa7b8e9020d3b (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.cpp4
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;