Skip to content
Snippets Groups Projects
Commit e58ee43e authored by Lasse Holmstedt's avatar Lasse Holmstedt
Browse files

Fixed crash on deleting an item while resize tool is being hovered

Task-number: BAUHAUS-425
Reviewed-by: marco
parent ba6d1e6f
No related branches found
No related tags found
No related merge requests found
...@@ -221,7 +221,7 @@ void ResizeController::updatePosition() ...@@ -221,7 +221,7 @@ void ResizeController::updatePosition()
FormEditorItem* ResizeController::formEditorItem() const FormEditorItem* ResizeController::formEditorItem() const
{ {
return m_data->formEditorItem; return m_data->formEditorItem.data();
} }
QWeakPointer<ResizeControllerData> ResizeController::weakPointer() const QWeakPointer<ResizeControllerData> ResizeController::weakPointer() const
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
QWeakPointer<LayerItem> layerItem; QWeakPointer<LayerItem> layerItem;
FormEditorItem *formEditorItem; QWeakPointer<FormEditorItem> formEditorItem;
ResizeHandleItem *topLeftItem; ResizeHandleItem *topLeftItem;
ResizeHandleItem *topRightItem; ResizeHandleItem *topRightItem;
ResizeHandleItem *bottomLeftItem; ResizeHandleItem *bottomLeftItem;
......
...@@ -62,7 +62,7 @@ void ResizeTool::mousePressEvent(const QList<QGraphicsItem*> &itemList, ...@@ -62,7 +62,7 @@ void ResizeTool::mousePressEvent(const QList<QGraphicsItem*> &itemList,
return; return;
ResizeHandleItem *resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first()); ResizeHandleItem *resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
if (resizeHandle) { if (resizeHandle && resizeHandle->resizeController().isValid()) {
m_resizeManipulator.setHandle(resizeHandle); m_resizeManipulator.setHandle(resizeHandle);
m_resizeManipulator.begin(event->scenePos()); m_resizeManipulator.begin(event->scenePos());
m_resizeIndicator.hide(); m_resizeIndicator.hide();
...@@ -92,7 +92,7 @@ void ResizeTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList, ...@@ -92,7 +92,7 @@ void ResizeTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
if (itemList.isEmpty()) if (itemList.isEmpty())
return; return;
ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first()); ResizeHandleItem* resizeHandle = ResizeHandleItem::fromGraphicsItem(itemList.first());
if (resizeHandle) { if (resizeHandle && resizeHandle->resizeController().isValid()) {
m_resizeManipulator.setHandle(resizeHandle); m_resizeManipulator.setHandle(resizeHandle);
} else { } else {
view()->changeToSelectionTool(); view()->changeToSelectionTool();
......
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