Skip to content

Commit

Permalink
Make undo acting though the macro, when item(s) are deleted on scene
Browse files Browse the repository at this point in the history
  • Loading branch information
gpospelov committed Jan 18, 2021
1 parent 567d0c1 commit 250cc3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/nodeeditor/nodeeditorcore/graphicsscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ void GraphicsScene::updateScene()

void GraphicsScene::onDeleteSelectedRequest()
{
ModelView::Utils::BeginMacros(m_model, "onDeleteSelectedRequest");

// Break explicitely selected connections.
for (auto connection : selectedViewItems<NodeConnection>())
disconnectConnectedViews(connection);
Expand All @@ -150,6 +152,8 @@ void GraphicsScene::onDeleteSelectedRequest()
// deleting item
ModelView::Utils::DeleteItemFromModel(view->connectableItem());
}

ModelView::Utils::EndMacros(m_model);
}

//! Constructs a view for a given item and adds it to a scene, if necessary.
Expand Down

0 comments on commit 250cc3a

Please sign in to comment.