diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp index 34eec2d53..3a6b917e5 100644 --- a/sources/editor/editorcommands.cpp +++ b/sources/editor/editorcommands.cpp @@ -109,7 +109,7 @@ void PastePartsCommand::redo() { editor_view_ -> start_top_left_corner_ = new_start_top_left_corner_; } } - foreach(QGraphicsItem *part, content_) part -> setSelected(true); + editor_scene_ -> slot_select(content_); editor_view_ -> adjustSceneRect(); } diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index 2110c153e..ed591de95 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -681,14 +681,22 @@ void ElementScene::paste() { } +/** + Selectionne une liste de parties + @param content liste des parties a selectionner +*/ +void ElementScene::slot_select(const ElementContent &content) { + blockSignals(true); + foreach(QGraphicsItem *qgi, content) qgi -> setSelected(true); + blockSignals(false); + emit(selectionChanged()); +} + /** Selectionne tout */ void ElementScene::slot_selectAll() { - blockSignals(true); - foreach(QGraphicsItem *qgi, items()) qgi -> setSelected(true); - blockSignals(false); - emit(selectionChanged()); + slot_select(items()); } /** diff --git a/sources/editor/elementscene.h b/sources/editor/elementscene.h index 3703910f4..cf32a3ce0 100644 --- a/sources/editor/elementscene.h +++ b/sources/editor/elementscene.h @@ -159,6 +159,7 @@ class ElementScene : public QGraphicsScene { void slot_addArc(); void slot_addTerminal(); void slot_addTextField(); + void slot_select(const ElementContent &); void slot_selectAll(); void slot_deselectAll(); void slot_invertSelection();