Skip to content

Commit

Permalink
MeasureGui: Auto close task on document deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorus committed Sep 17, 2024
1 parent 758674d commit 1c24ec2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Mod/Measure/Gui/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void StdCmdMeasure::activated(int iMsg)
Q_UNUSED(iMsg);

Gui::TaskMeasure* task = new Gui::TaskMeasure();
task->setDocumentName(this->getDocument()->getName());
Gui::Control().showDialog(task);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Measure/Gui/TaskMeasure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TaskMeasure::TaskMeasure()
App::GetApplication().setActiveTransaction("Add Measurement");
}


setAutoCloseOnDeletedDocument(true);
// Call invoke method delayed, otherwise the dialog might not be fully initialized
QTimer::singleShot(0, this, &TaskMeasure::invoke);
}
Expand Down

0 comments on commit 1c24ec2

Please sign in to comment.