Some changes crash related

preferencesAboutTextFull
Ilia Ryabokon 12 years ago
parent 4ec54ee3a8
commit e232bbc900
  1. 29
      src/domain/UBGraphicsScene.cpp
  2. 1
      src/frameworks/UBCoreGraphicsScene.cpp

@ -1099,6 +1099,11 @@ void UBGraphicsScene::clearItemsAndAnnotations()
setDocumentUpdated();
}
bool isService(QGraphicsItem *item) {
return (item->type() == UBGraphicsDelegateFrame::Type)
|| (item->parentItem() && item->parentItem()->Type == UBGraphicsDelegateFrame::Type);
}
void UBGraphicsScene::clearItems()
{
deselectAllItems();
@ -1113,9 +1118,13 @@ void UBGraphicsScene::clearItems()
bool isPolygon = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item) != NULL;
bool isStrokesGroup = qgraphicsitem_cast<UBGraphicsStrokesGroup*>(item) != NULL;
if(!isGroup && !isPolygon && !isStrokesGroup && !mTools.contains(item) && !isBackgroundObject(item))
{
bool inGroup = (item->parentItem()
&& (item->parentItem()->type() == UBGraphicsGroupContainerItem::Type));
if(!isGroup && !isPolygon && !isStrokesGroup && !mTools.contains(item) && !isBackgroundObject(item)) {
removeItem(item);
}
if (!inGroup || !isService(item)) {
removedItems << item;
}
}
@ -1611,14 +1620,14 @@ void UBGraphicsScene::removeItem(QGraphicsItem* item)
mFastAccessItems.removeAll(item);
if (group)
{
if (group->childItems().empty())
{
group->Delegate()->remove();
UBCoreGraphicsScene::removeItemFromDeletion(group);
}
}
// if (group)
// {
// if (group->childItems().empty())
// {
// group->Delegate()->remove();
// UBCoreGraphicsScene::removeItemFromDeletion(group);
// }
// }
}
void UBGraphicsScene::removeItems(const QSet<QGraphicsItem*>& items)

@ -73,6 +73,7 @@ void UBCoreGraphicsScene::removeItem(QGraphicsItem* item, bool forceDelete)
QGraphicsScene::removeItem(item);
if (forceDelete)
{
qDebug() << "force delete is " << forceDelete;
deleteItem(item);
}
setModified(true);

Loading…
Cancel
Save