mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Fix bug 244
I was thinking that the commit 5a51f6bace
fix the bug 244, but not they only fix this bug :
https://qelectrotech.org/forum/viewtopic.php?pid=16022#p16022
This commit really fix the bug 244
This commit is contained in:
@@ -137,15 +137,20 @@ Diagram::~Diagram()
|
||||
delete m_event_interface;
|
||||
|
||||
// list removable items
|
||||
QList<QGraphicsItem *> deletable_items;
|
||||
for(QGraphicsItem *qgi : items())
|
||||
QVector<QGraphicsItem *> deletable_items;
|
||||
for(const auto &qgi : items())
|
||||
{
|
||||
if (qgi -> parentItem()) continue;
|
||||
if (qgraphicsitem_cast<Conductor *>(qgi)) continue;
|
||||
deletable_items << qgi;
|
||||
if (qgi->parentItem())
|
||||
continue;
|
||||
if (qgraphicsitem_cast<Conductor *>(qgi))
|
||||
continue;
|
||||
deletable_items.append(qgi);
|
||||
}
|
||||
for (const auto &item : qAsConst(deletable_items))
|
||||
{
|
||||
removeItem(item);
|
||||
delete item;
|
||||
}
|
||||
|
||||
qDeleteAll (deletable_items);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user