@ -1212,7 +1212,9 @@ void UBBoardController::ClearUndoStack()
QGraphicsItem* item = itUniq.next();
UBGraphicsScene *scene = (UBGraphicsScene*)item->scene();
if(!scene)
delete item;
{
bool retCode = mActiveScene->deleteItem(item);
}
@ -53,3 +53,16 @@ void UBCoreGraphicsScene::removeItem(QGraphicsItem* item, bool forceDelete)
bool UBCoreGraphicsScene::deleteItem(QGraphicsItem* item)
if(mItemsToDelete.contains(item))
mItemsToDelete.remove(item);
return true;
else
return false;
@ -28,6 +28,9 @@ class UBCoreGraphicsScene : public QGraphicsScene
virtual void removeItem(QGraphicsItem* item, bool forceDelete = false);
virtual bool deleteItem(QGraphicsItem* item);
private:
QSet<QGraphicsItem*> mItemsToDelete;
};