mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Element editor : improve deletion speed
This commit is contained in:
parent
eee1c7fff7
commit
d6e8a1c133
@ -745,9 +745,19 @@ void ElementScene::addItems(QVector<QGraphicsItem *> items)
|
||||
*/
|
||||
void ElementScene::removeItems(QVector<QGraphicsItem *> items)
|
||||
{
|
||||
const int previous_selected_count{selectedItems().size()};
|
||||
|
||||
//block signal to avoid multiple emit of selection changed,
|
||||
//we emit this signal only once at the end of this function.
|
||||
blockSignals(true);
|
||||
for (const auto &item : items) {
|
||||
removeItem(item);
|
||||
}
|
||||
blockSignals(false);
|
||||
|
||||
if (previous_selected_count != selectedItems().size()) {
|
||||
emit selectionChanged();
|
||||
}
|
||||
|
||||
emit partsRemoved();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user