Skip to content
Snippets Groups Projects
Commit b0c5380d authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.FormEditor: crash fix


Anchors and/or anchor targets might be invalid.
e.g.: anchors.left: parent

We have to check this.

Task-number: QTCREATORBUG-11255
Change-Id: Ib939292d0f89cc1d22119972627c03f1e85043db
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent ac40c26e
No related branches found
No related tags found
No related merge requests found
......@@ -211,24 +211,26 @@ static void updateAnchorLinePoints(QPointF *firstPoint, QPointF *secondPoint, co
void AnchorIndicatorGraphicsItem::updateAnchorIndicator(const AnchorLine &sourceAnchorLine, const AnchorLine targetAnchorLine)
{
m_sourceAnchorLineType = sourceAnchorLine.type();
m_targetAnchorLineType = targetAnchorLine.type();
if (sourceAnchorLine.isValid() && targetAnchorLine.isValid()) {
m_sourceAnchorLineType = sourceAnchorLine.type();
m_targetAnchorLineType = targetAnchorLine.type();
m_startPoint = createAnchorPoint(sourceAnchorLine.qmlItemNode(), sourceAnchorLine.type());
m_startPoint = createAnchorPoint(sourceAnchorLine.qmlItemNode(), sourceAnchorLine.type());
if (targetAnchorLine.qmlItemNode() == sourceAnchorLine.qmlItemNode().instanceParentItem())
m_endPoint = createParentAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type(), sourceAnchorLine.qmlItemNode());
else
m_endPoint = createAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type());
if (targetAnchorLine.qmlItemNode() == sourceAnchorLine.qmlItemNode().instanceParentItem())
m_endPoint = createParentAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type(), sourceAnchorLine.qmlItemNode());
else
m_endPoint = createAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type());
m_firstControlPoint = createControlPoint(m_startPoint, sourceAnchorLine.type(), m_endPoint);
m_secondControlPoint = createControlPoint(m_endPoint, targetAnchorLine.type(), m_startPoint);
m_firstControlPoint = createControlPoint(m_startPoint, sourceAnchorLine.type(), m_endPoint);
m_secondControlPoint = createControlPoint(m_endPoint, targetAnchorLine.type(), m_startPoint);
updateAnchorLinePoints(&m_sourceAnchorLineFirstPoint, &m_sourceAnchorLineSecondPoint, sourceAnchorLine);
updateAnchorLinePoints(&m_targetAnchorLineFirstPoint, &m_targetAnchorLineSecondPoint, targetAnchorLine);
updateAnchorLinePoints(&m_sourceAnchorLineFirstPoint, &m_sourceAnchorLineSecondPoint, sourceAnchorLine);
updateAnchorLinePoints(&m_targetAnchorLineFirstPoint, &m_targetAnchorLineSecondPoint, targetAnchorLine);
updateBoundingRect();
update();
updateBoundingRect();
update();
}
}
void AnchorIndicatorGraphicsItem::updateBoundingRect()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment