forked from qt-creator/qt-creator
QmlDesigner: Fix flickering move cursor
The check for selectedItemCursorInMovableArea has to be the first check, because otherwise we might change back to the selection tool if e.g. the item list is empty. This leads to a flickering cursor and bad usabilty. Change-Id: I0ea82cd1c4bf83cde0b173ab08f19bd04b1128c0 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
214f87b69b
commit
a4cb8479a3
@@ -124,23 +124,26 @@ 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();
|
||||
return;
|
||||
}
|
||||
|
||||
if (view()->hasSingleSelectedModelNode() && selectedItemCursorInMovableArea(event->scenePos()))
|
||||
return;
|
||||
|
||||
if (itemList.isEmpty()) {
|
||||
view()->changeToSelectionTool();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!topSelectedItemIsMovable(itemList)) {
|
||||
view()->changeToSelectionTool();
|
||||
return;
|
||||
}
|
||||
|
||||
if (view()->hasSingleSelectedModelNode() && !selectedItemCursorInMovableArea(event->scenePos())) {
|
||||
if (view()->hasSingleSelectedModelNode()) {
|
||||
view()->changeToSelectionTool();
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user