OSDN Git Service

QmlDesigner.propertyEditor: remove leftovers if anchoring
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 29 Apr 2010 12:26:16 +0000 (14:26 +0200)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 29 Apr 2010 12:27:29 +0000 (14:27 +0200)
x, y, width, height are removed if filling
x is removed if anchoring the left...
y is removed if anchoring the top...
width is removed if anchoring the right...
height is removed if anchoring the bottom...

src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp

index 3c55067..d087c72 100644 (file)
@@ -290,6 +290,7 @@ void QmlAnchorBindingProxy::setBottomAnchor(bool anchor)
         removeBottomAnchor();
     } else {
         calcBottomMargin();
+        m_fxItemNode.removeVariantProperty("height");
     }
     emit bottomAnchorChanged();
 
@@ -311,6 +312,7 @@ void QmlAnchorBindingProxy::setLeftAnchor(bool anchor)
         removeLeftAnchor();
     } else {
         calcLeftMargin();
+        m_fxItemNode.removeVariantProperty("width");
     }
     emit leftAnchorChanged();
     if (hasAnchors() != anchor)
@@ -331,6 +333,7 @@ void QmlAnchorBindingProxy::setRightAnchor(bool anchor)
         removeRightAnchor();
     } else {
         calcRightMargin();
+        m_fxItemNode.removeVariantProperty("x");
     }
     emit rightAnchorChanged();
     if (hasAnchors() != anchor)
@@ -441,6 +444,7 @@ void QmlAnchorBindingProxy::setTopAnchor(bool anchor)
         removeTopAnchor();
     } else {
         calcTopMargin();
+        m_fxItemNode.removeVariantProperty("y");
     }
     emit topAnchorChanged();
     if (hasAnchors() != anchor)
@@ -538,6 +542,11 @@ void QmlAnchorBindingProxy::fill()
     m_fxItemNode.anchors().removeMargin(AnchorLine::Top);
     m_fxItemNode.anchors().removeMargin(AnchorLine::Bottom);
 
+    m_fxItemNode.removeVariantProperty("x");
+    m_fxItemNode.removeVariantProperty("y");
+    m_fxItemNode.removeVariantProperty("width");
+    m_fxItemNode.removeVariantProperty("height");
+
     emit topAnchorChanged();
     emit bottomAnchorChanged();
     emit leftAnchorChanged();