void UBGraphicsGroupContainerItem::removeFromGroup(QGraphicsItem *item)
{
    if (!item) {
        qDebug() << "can't specify the item because of the null pointer";
    }

    UBGraphicsScene *groupScene = scene();
    if (groupScene) {
        groupScene->addItemToDeletion(item);
    }

    pRemoveFromGroup(item);

}
void UBGraphicsGroupContainerItem::destroy() {

    UBGraphicsScene *groupScene = scene();


    foreach (QGraphicsItem *item, childItems()) {

        if (groupScene) {
            groupScene->addItemToDeletion(item);
        }

        pRemoveFromGroup(item);
        item->setFlag(QGraphicsItem::ItemIsSelectable, true);
        item->setFlag(QGraphicsItem::ItemIsFocusable, true);
    }

    remove();
}