|
|
|
@ -44,21 +44,4 @@ void UBGraphicsGroupContainerItemDelegate::decorateMenu(QMenu *menu) |
|
|
|
|
void UBGraphicsGroupContainerItemDelegate::buildButtons() |
|
|
|
|
{ |
|
|
|
|
UBGraphicsItemDelegate::buildButtons(); |
|
|
|
|
|
|
|
|
|
mDestroyGroupButton = new DelegateButton(":/images/font.svg", mDelegated, mFrame, Qt::TopLeftSection); |
|
|
|
|
|
|
|
|
|
mButtons << mDestroyGroupButton; |
|
|
|
|
|
|
|
|
|
connect(mDestroyGroupButton, SIGNAL(clicked()), (UBGraphicsGroupContainerItemDelegate*)this, SLOT(destroyGroup())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBGraphicsGroupContainerItemDelegate::destroyGroup() |
|
|
|
|
{ |
|
|
|
|
qDebug() << "got an event"; |
|
|
|
|
foreach (QGraphicsItem *item, delegated()->childItems()) { |
|
|
|
|
delegated()->removeFromGroup(item); |
|
|
|
|
item->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
remove(true); |
|
|
|
|
} |
|
|
|
|