mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-14 11:19:03 +00:00
Fixed: #1302 Fixed crash program.
This commit is contained in:
parent
e6444cb2b1
commit
bf08374d32
3 changed files with 12 additions and 1 deletions
|
@ -121,7 +121,7 @@ void removeGraphicsItems(const QModelIndex &primIndex, PrimitivesTreeModel *mode
|
||||||
{
|
{
|
||||||
QGraphicsItem *item = qvariant_cast<QGraphicsItem *>(node->data(Constants::GRAPHICS_DATA_QT4_2D));
|
QGraphicsItem *item = qvariant_cast<QGraphicsItem *>(node->data(Constants::GRAPHICS_DATA_QT4_2D));
|
||||||
if (item != 0)
|
if (item != 0)
|
||||||
delete item;
|
scene->removeWorldItem(item);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,15 @@ QGraphicsItem *WorldEditorScene::addWorldItemZone(const QPolygonF &polygon)
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldEditorScene::removeWorldItem(QGraphicsItem *item)
|
||||||
|
{
|
||||||
|
updateSelectedItems(true);
|
||||||
|
m_selectedItems.clear();
|
||||||
|
m_editedSelectedItems = false;
|
||||||
|
m_firstSelection = false;
|
||||||
|
delete item;
|
||||||
|
}
|
||||||
|
|
||||||
void WorldEditorScene::setModeEdit(WorldEditorScene::ModeEdit mode)
|
void WorldEditorScene::setModeEdit(WorldEditorScene::ModeEdit mode)
|
||||||
{
|
{
|
||||||
if (mode == WorldEditorScene::SelectMode)
|
if (mode == WorldEditorScene::SelectMode)
|
||||||
|
|
|
@ -59,6 +59,8 @@ public:
|
||||||
QGraphicsItem *addWorldItemPath(const QPolygonF &polyline);
|
QGraphicsItem *addWorldItemPath(const QPolygonF &polyline);
|
||||||
QGraphicsItem *addWorldItemZone(const QPolygonF &polygon);
|
QGraphicsItem *addWorldItemZone(const QPolygonF &polygon);
|
||||||
|
|
||||||
|
void removeWorldItem(QGraphicsItem *item);
|
||||||
|
|
||||||
void setModeEdit(WorldEditorScene::ModeEdit mode);
|
void setModeEdit(WorldEditorScene::ModeEdit mode);
|
||||||
WorldEditorScene::ModeEdit editMode() const;
|
WorldEditorScene::ModeEdit editMode() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue