|
|
@ -91,9 +91,16 @@ void UBGraphicsItemUndoCommand::undo() |
|
|
|
while (itRemoved.hasNext()) |
|
|
|
while (itRemoved.hasNext()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QGraphicsItem* item = itRemoved.next(); |
|
|
|
QGraphicsItem* item = itRemoved.next(); |
|
|
|
|
|
|
|
if (item) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (UBItemLayerType::FixedBackground == item->data(UBGraphicsItemData::ItemLayerType)) |
|
|
|
|
|
|
|
mScene->setAsBackgroundObject(item); |
|
|
|
|
|
|
|
else |
|
|
|
mScene->addItem(item); |
|
|
|
mScene->addItem(item); |
|
|
|
|
|
|
|
|
|
|
|
UBApplication::boardController->freezeW3CWidget(item, false); |
|
|
|
UBApplication::boardController->freezeW3CWidget(item, false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
|
|
|
|
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
|
|
|
|
mScene->update(mScene->sceneRect()); |
|
|
|
mScene->update(mScene->sceneRect()); |
|
|
@ -123,9 +130,16 @@ void UBGraphicsItemUndoCommand::redo() |
|
|
|
while (itAdded.hasNext()) |
|
|
|
while (itAdded.hasNext()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QGraphicsItem* item = itAdded.next(); |
|
|
|
QGraphicsItem* item = itAdded.next(); |
|
|
|
|
|
|
|
if (item) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (UBItemLayerType::FixedBackground == item->data(UBGraphicsItemData::ItemLayerType)) |
|
|
|
|
|
|
|
mScene->setAsBackgroundObject(item); |
|
|
|
|
|
|
|
else |
|
|
|
mScene->addItem(item); |
|
|
|
mScene->addItem(item); |
|
|
|
|
|
|
|
|
|
|
|
UBApplication::boardController->freezeW3CWidget(item, false); |
|
|
|
UBApplication::boardController->freezeW3CWidget(item, false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2) to trigger repaint
|
|
|
|
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2) to trigger repaint
|
|
|
|
mScene->update(mScene->sceneRect()); |
|
|
|
mScene->update(mScene->sceneRect()); |
|
|
|