Skip to content

Commit

Permalink
Title:fix Delete element selection problem
Browse files Browse the repository at this point in the history
Description:Fixed issue with deleting primitive selection

RootCause:Null

Solution:Fixed issue with deleting primitive selection
  • Loading branch information
wyu71 committed Apr 8, 2020
1 parent 53bdcd4 commit 86a0bf5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frame/cundocommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void CAddShapeCommand::undo()
myGraphicsScene->setModify(true);

QList<QGraphicsItem *> allItems = myGraphicsScene->items();
myGraphicsScene->getItemsMgr()->clear();
for (int i = 0; i < m_items.size(); i++) {
QGraphicsItem *item = m_items.at(i);
if (allItems.contains(static_cast<CGraphicsItem *>(item))) {
Expand Down Expand Up @@ -354,6 +355,7 @@ void CAddShapeCommand::redo()
}
}

myGraphicsScene->getItemsMgr()->clear();
if (m_items.size() == 1) {
myGraphicsScene->clearSelection();
m_items.at(0)->setSelected(true);
Expand Down

0 comments on commit 86a0bf5

Please sign in to comment.