Commit 2307e10a authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Fix crash

This was introduced when adjusting the selection behaivour.
We have to check for the empty list before we call
itemList.first().

Change-Id: I12a12bc17f1f513304c8df738e76db999267854a
Reviewed-by: Vikas Pachdha's avatarVikas Pachdha <vikas.pachdha@qt.io>
parent aa3270a1
......@@ -124,6 +124,11 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent * event)
{
if (itemList.isEmpty()) {
view()->changeToSelectionTool();
return;
}
ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
if (resizeHandle) {
view()->changeToResizeTool();
......@@ -133,11 +138,6 @@ void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
if (view()->hasSingleSelectedModelNode() && selectedItemCursorInMovableArea(event->scenePos()))
return;
if (itemList.isEmpty()) {
view()->changeToSelectionTool();
return;
}
if (!topSelectedItemIsMovable(itemList)) {
view()->changeToSelectionTool();
return;
......
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