mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Element editor : improve deletion speed
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user