fixed an issue where duplicated grouped items were losing zlevel order

preferencesAboutTextFull
Clément Fauconnier 6 years ago
parent 1a425b015d
commit 0cccd34024
  1. 7
      src/board/UBBoardController.cpp

@ -694,10 +694,15 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
mActiveScene->setURStackEnable(false); mActiveScene->setURStackEnable(false);
foreach(QGraphicsItem* pIt, children){ foreach(QGraphicsItem* pIt, children){
UBItem* pItem = dynamic_cast<UBItem*>(pIt); UBItem* pItem = dynamic_cast<UBItem*>(pIt);
if(pItem){ if(pItem)
{
QGraphicsItem * itemToGroup = dynamic_cast<QGraphicsItem *>(duplicateItem(pItem)); QGraphicsItem * itemToGroup = dynamic_cast<QGraphicsItem *>(duplicateItem(pItem));
if (itemToGroup) if (itemToGroup)
{
itemToGroup->setZValue(pIt->zValue());
itemToGroup->setData(UBGraphicsItemData::ItemOwnZValue, pIt->data(UBGraphicsItemData::ItemOwnZValue).toReal());
duplicatedItems.append(itemToGroup); duplicatedItems.append(itemToGroup);
}
} }
} }
duplicatedGroup = mActiveScene->createGroup(duplicatedItems); duplicatedGroup = mActiveScene->createGroup(duplicatedItems);

Loading…
Cancel
Save