ModelEditor: Remove code duplication in action handler

Change-Id: I7d4beff0c0408c0ef8655953434c9d324fb452cc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2018-01-31 13:15:45 +01:00
parent ebc975e4a4
commit 9c68afa08c
4 changed files with 41 additions and 129 deletions

View File

@@ -569,7 +569,17 @@ void ModelEditor::editSelectedItem()
onEditSelectedElement();
}
void ModelEditor::exportDiagram(bool selectedElements)
void ModelEditor::exportDiagram()
{
exportToImage(/*selectedElements=*/false);
}
void ModelEditor::exportSelectedElements()
{
exportToImage(/*selectedElements=*/true);
}
void ModelEditor::exportToImage(bool selectedElements)
{
qmt::MDiagram *diagram = currentDiagram();
if (diagram) {