mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-30 14:54:13 +02:00
Merge pull request #1150 from ispyisail/fix/1144-group-menu-refresh
Fix right-click menu offering Group again after grouping (#1144)
This commit is contained in:
@@ -2279,6 +2279,7 @@ void Diagram::setItemGroup(QGraphicsItem *item, const QUuid &group)
|
||||
if (m_project) {
|
||||
m_project->dataBase()->itemGroupChanged(item);
|
||||
}
|
||||
emit itemGroupChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -325,6 +325,10 @@ class Diagram : public QGraphicsScene
|
||||
|
||||
void diagramActivated();
|
||||
void diagramInformationChanged();
|
||||
|
||||
/// Emitted by setItemGroup(): an item joined or left a group
|
||||
/// without the selection changing (#1144)
|
||||
void itemGroupChanged();
|
||||
};
|
||||
Q_DECLARE_METATYPE(Diagram *)
|
||||
|
||||
|
||||
@@ -3185,6 +3185,12 @@ void QETDiagramEditor::diagramWasAdded(DiagramView *dv)
|
||||
this,
|
||||
&QETDiagramEditor::selectionChanged,
|
||||
Qt::DirectConnection);
|
||||
//Grouping leaves the selection as it is, so without this Group
|
||||
//and Ungroup would keep the state from before (#1144)
|
||||
connect(dv->diagram(),
|
||||
&Diagram::itemGroupChanged,
|
||||
this,
|
||||
&QETDiagramEditor::slot_updateComplexActions);
|
||||
connect(dv, &DiagramView::modeChanged, this, &QETDiagramEditor::slot_updateModeActions);
|
||||
connect(dv, &DiagramView::elementPlacementStarted, this, &QETDiagramEditor::rememberPlacedElement);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user