From fe00d3ab5995c1a9d508a73ad2346de95b83df1e Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 7 Nov 2021 19:16:46 +0100 Subject: [PATCH] [PD] fixes loft visibility on creation and modification - the PR fixes the issue reported here: https://forum.freecadweb.org/viewtopic.php?f=3&t=63252 - (also a MSVC code formatting fix) --- src/Mod/PartDesign/Gui/TaskLoftParameters.cpp | 11 +++++++---- src/Mod/PartDesign/Gui/TaskLoftParameters.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp index 9ae610ef18..8872cd069e 100644 --- a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp @@ -121,10 +121,6 @@ TaskLoftParameters::TaskLoftParameters(ViewProviderLoft *LoftView, bool /*newObj ui->checkBoxRuled->setChecked(loft->Ruled.getValue()); ui->checkBoxClosed->setChecked(loft->Closed.getValue()); - if (!loft->Sections.getValues().empty()) { - LoftView->makeTemporaryVisible(true); - } - // activate and de-activate dialog elements as appropriate for (QWidget* child : proxy->findChildren()) child->blockSignals(false); @@ -138,6 +134,10 @@ TaskLoftParameters::~TaskLoftParameters() void TaskLoftParameters::updateUI() { + // we must assure the changed loft is kept visible on section changes, + // see https://forum.freecadweb.org/viewtopic.php?f=3&t=63252 + PartDesign::Loft* loft = static_cast(vp->getObject()); + vp->makeTemporaryVisible(!loft->Sections.getValues().empty()); } void TaskLoftParameters::onSelectionChanged(const Gui::SelectionChanges& msg) @@ -172,6 +172,7 @@ void TaskLoftParameters::onSelectionChanged(const Gui::SelectionChanges& msg) clearButtons(); exitSelectionMode(); + updateUI(); } } @@ -255,6 +256,7 @@ void TaskLoftParameters::onDeleteSection() //static_cast(vp)->highlightReferences(false, true); recomputeFeature(); + updateUI(); } } } @@ -278,6 +280,7 @@ void TaskLoftParameters::indexesMoved() loft->Sections.setValues(originals); recomputeFeature(); + updateUI(); } void TaskLoftParameters::clearButtons() { diff --git a/src/Mod/PartDesign/Gui/TaskLoftParameters.h b/src/Mod/PartDesign/Gui/TaskLoftParameters.h index e04011ef4b..a3dd8c5ccb 100644 --- a/src/Mod/PartDesign/Gui/TaskLoftParameters.h +++ b/src/Mod/PartDesign/Gui/TaskLoftParameters.h @@ -50,7 +50,7 @@ class TaskLoftParameters : public TaskSketchBasedParameters Q_OBJECT public: - TaskLoftParameters(ViewProviderLoft *LoftView,bool newObj=false,QWidget *parent = 0); + TaskLoftParameters(ViewProviderLoft *LoftView, bool newObj=false, QWidget *parent = 0); ~TaskLoftParameters(); private Q_SLOTS: