PD: enable selection only on request and disable it after selecting an object

This commit is contained in:
wmayer
2021-12-07 13:06:48 +01:00
parent 90db4c885b
commit 8424c9323b
4 changed files with 13 additions and 5 deletions

View File

@@ -63,7 +63,8 @@ TaskSketchBasedParameters::TaskSketchBasedParameters(PartDesignGui::ViewProvider
const std::string& pixmapname, const QString& parname)
: TaskFeatureParameters(vp, parent, pixmapname, parname)
{
// disable selection
this->blockConnection(true);
}
const QString TaskSketchBasedParameters::onAddSelection(const Gui::SelectionChanges& msg)
@@ -122,12 +123,14 @@ void TaskSketchBasedParameters::onSelectReference(AllowSelectionFlags allow) {
if (AllowSelectionFlags::Int(allow) != int(AllowSelection::NONE)) {
startReferenceSelection(pcSketchBased, prevSolid);
this->blockConnection(false);
Gui::Selection().clearSelection();
Gui::Selection().addSelectionGate(new ReferenceSelection(prevSolid, allow));
}
else {
Gui::Selection().rmvSelectionGate();
finishReferenceSelection(pcSketchBased, prevSolid);
this->blockConnection(true);
}
}
}