Commit 4ac93806 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Remove unused code in anchors

Change-Id: I079eaebb933a8566b2391b7ea274ba6c3e4d36ce
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 9d967d4b
......@@ -115,8 +115,6 @@ public:
QmlItemNode qmlItemNode() const;
protected:
void beautify();
private:
QmlItemNode m_qmlItemNode;
......
......@@ -124,52 +124,6 @@ bool QmlAnchors::isValid() const
return m_qmlItemNode.isValid();
}
void QmlAnchors::beautify()
{
return;
if ((instanceHasAnchor(AnchorLine::Left) &&
instanceHasAnchor(AnchorLine::Right) &&
instanceHasAnchor(AnchorLine::Top) &&
instanceHasAnchor(AnchorLine::Bottom)) &&
(instanceAnchor(AnchorLine::Left).type() == AnchorLine::Left &&
instanceAnchor(AnchorLine::Right).type() == AnchorLine::Right &&
instanceAnchor(AnchorLine::Top).type() == AnchorLine::Top &&
instanceAnchor(AnchorLine::Bottom).type() == AnchorLine::Bottom) &&
(instanceAnchor(AnchorLine::Left).qmlItemNode() ==
instanceAnchor(AnchorLine::Right).qmlItemNode() &&
instanceAnchor(AnchorLine::Top).qmlItemNode() ==
instanceAnchor(AnchorLine::Bottom).qmlItemNode()) &&
(instanceAnchor(AnchorLine::Left).qmlItemNode() ==
instanceAnchor(AnchorLine::Bottom).qmlItemNode())) {
if (instanceHasAnchor(AnchorLine::Fill))
return; //avoid recursion
QmlItemNode targetNode(instanceAnchor(AnchorLine::Left).qmlItemNode());
removeAnchors();
setAnchor(AnchorLine::Fill, targetNode, AnchorLine::Fill);
}
if ((instanceHasAnchor(AnchorLine::VerticalCenter) &&
instanceHasAnchor(AnchorLine::HorizontalCenter)) &&
(instanceAnchor(AnchorLine::VerticalCenter).type() == AnchorLine::VerticalCenter &&
instanceAnchor(AnchorLine::HorizontalCenter).type() == AnchorLine::HorizontalCenter) &&
(instanceAnchor(AnchorLine::VerticalCenter).qmlItemNode() ==
instanceAnchor(AnchorLine::HorizontalCenter).qmlItemNode())) {
if (instanceHasAnchor(AnchorLine::Center))
return; //avoid recursion
QmlItemNode targetNode(instanceAnchor(AnchorLine::VerticalCenter).qmlItemNode());
removeAnchors();
setAnchor(AnchorLine::Center, targetNode, AnchorLine::Center);
}
}
void QmlAnchors::setAnchor(AnchorLine::Type sourceAnchorLine,
const QmlItemNode &targetQmlItemNode,
AnchorLine::Type targetAnchorLine)
......@@ -189,7 +143,6 @@ void QmlAnchors::setAnchor(AnchorLine::Type sourceAnchorLine,
targetExpression = targetExpression + QLatin1Char('.') + lineTypeToString(targetAnchorLine);
qmlItemNode().modelNode().bindingProperty(propertyName).setExpression(targetExpression);
}
beautify();
}
bool detectHorizontalCycle(const ModelNode &node, QList<ModelNode> knownNodeList)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment