Core: Enable TaskDialogs to associate view (#17373)
* Core: Add possibility for task dialogs to associate a view and be able to close when associated view is closed. * TaskImage: Use task dialog view association. * Sketcher: Use task dialog view association. Preventing crash (https://github.com/FreeCAD/FreeCAD/issues/16702) * EditableDatumLabel: Use QPointer to prevent crash
This commit is contained in:
@@ -79,6 +79,8 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch* sketchView)
|
||||
std::bind(&SketcherGui::TaskDlgEditSketch::slotToolChanged, this, sp::_1));
|
||||
|
||||
ToolSettings->setHidden(true);
|
||||
|
||||
associateToObject3dView(sketchView->getObject());
|
||||
}
|
||||
|
||||
TaskDlgEditSketch::~TaskDlgEditSketch()
|
||||
@@ -145,4 +147,10 @@ bool TaskDlgEditSketch::reject()
|
||||
}
|
||||
|
||||
|
||||
void TaskDlgEditSketch::autoClosedOnClosedView()
|
||||
{
|
||||
// Make sure the edit mode is exited when the view is closed.
|
||||
reject();
|
||||
}
|
||||
|
||||
#include "moc_TaskDlgEditSketch.cpp"
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void autoClosedOnClosedView() override;
|
||||
|
||||
/// returns for Close and Help button
|
||||
QDialogButtonBox::StandardButtons getStandardButtons() const override
|
||||
|
||||
Reference in New Issue
Block a user