Fixed sankore crashes at deletion groups at deletion a scene.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent 3eb0bdda70
commit fcb9845cb1
  1. 10
      src/domain/UBGraphicsGroupContainerItem.cpp
  2. 1
      src/domain/UBGraphicsGroupContainerItem.h

@ -32,6 +32,16 @@ UBGraphicsGroupContainerItem::UBGraphicsGroupContainerItem(QGraphicsItem *parent
}
UBGraphicsGroupContainerItem::~UBGraphicsGroupContainerItem()
{
foreach (QGraphicsItem *item, childItems())
{
removeFromGroup(item);
if (item && item->scene())
item->scene()->removeItem(item);
}
}
void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
{
if (!item) {

@ -10,6 +10,7 @@ class UBGraphicsGroupContainerItem : public QGraphicsItem, public UBItem, public
public:
UBGraphicsGroupContainerItem (QGraphicsItem *parent = 0);
virtual ~UBGraphicsGroupContainerItem();
void addToGroup(QGraphicsItem *item);
void removeFromGroup(QGraphicsItem *item);

Loading…
Cancel
Save