diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp index c6ed1ee3e..440382b15 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_actions.cpp @@ -121,7 +121,7 @@ void removeGraphicsItems(const QModelIndex &primIndex, PrimitivesTreeModel *mode { QGraphicsItem *item = qvariant_cast(node->data(Constants::GRAPHICS_DATA_QT4_2D)); if (item != 0) - delete item; + scene->removeWorldItem(item); break; } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.cpp index 6fba9f628..7e2ac9c20 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.cpp @@ -80,6 +80,15 @@ QGraphicsItem *WorldEditorScene::addWorldItemZone(const QPolygonF &polygon) return item; } +void WorldEditorScene::removeWorldItem(QGraphicsItem *item) +{ + updateSelectedItems(true); + m_selectedItems.clear(); + m_editedSelectedItems = false; + m_firstSelection = false; + delete item; +} + void WorldEditorScene::setModeEdit(WorldEditorScene::ModeEdit mode) { if (mode == WorldEditorScene::SelectMode) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.h index 408ba99b6..aa813c5c5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_scene.h @@ -59,6 +59,8 @@ public: QGraphicsItem *addWorldItemPath(const QPolygonF &polyline); QGraphicsItem *addWorldItemZone(const QPolygonF &polygon); + void removeWorldItem(QGraphicsItem *item); + void setModeEdit(WorldEditorScene::ModeEdit mode); WorldEditorScene::ModeEdit editMode() const;