|
|
@ -694,12 +694,17 @@ 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); |
|
|
|
duplicatedGroup->setTransform(groupItem->transform()); |
|
|
|
duplicatedGroup->setTransform(groupItem->transform()); |
|
|
|
groupItem->setSelected(false); |
|
|
|
groupItem->setSelected(false); |
|
|
|