From e31cd499b0f37d2a67d11fca697bde6f64368cf6 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sat, 5 Nov 2022 20:58:55 +0100 Subject: [PATCH] [PD] Helix: assure source Sketch is visible when in selection mode - same as https://github.com/FreeCAD/FreeCAD/commit/18781bcf6 but for Helices (fixes #7629 also for helices) - also modernize Qt connection --- .../PartDesign/Gui/TaskHelixParameters.cpp | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskHelixParameters.cpp b/src/Mod/PartDesign/Gui/TaskHelixParameters.cpp index a8340781de..876e92158d 100644 --- a/src/Mod/PartDesign/Gui/TaskHelixParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskHelixParameters.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -134,28 +134,28 @@ void TaskHelixParameters::connectSlots() { QMetaObject::connectSlotsByName(this); - connect(ui->pitch, SIGNAL(valueChanged(double)), - this, SLOT(onPitchChanged(double))); - connect(ui->height, SIGNAL(valueChanged(double)), - this, SLOT(onHeightChanged(double))); - connect(ui->turns, SIGNAL(valueChanged(double)), - this, SLOT(onTurnsChanged(double))); - connect(ui->coneAngle, SIGNAL(valueChanged(double)), - this, SLOT(onAngleChanged(double))); - connect(ui->growth, SIGNAL(valueChanged(double)), - this, SLOT(onGrowthChanged(double))); - connect(ui->axis, SIGNAL(activated(int)), - this, SLOT(onAxisChanged(int))); - connect(ui->checkBoxLeftHanded, SIGNAL(toggled(bool)), - this, SLOT(onLeftHandedChanged(bool))); - connect(ui->checkBoxReversed, SIGNAL(toggled(bool)), - this, SLOT(onReversedChanged(bool))); - connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)), - this, SLOT(onUpdateView(bool))); - connect(ui->inputMode, SIGNAL(activated(int)), - this, SLOT(onModeChanged(int))); - connect(ui->checkBoxOutside, SIGNAL(toggled(bool)), - this, SLOT(onOutsideChanged(bool))); + connect(ui->pitch, qOverload(&QuantitySpinBox::valueChanged), this, + &TaskHelixParameters::onPitchChanged); + connect(ui->height, qOverload(&QuantitySpinBox::valueChanged), this, + &TaskHelixParameters::onHeightChanged); + connect(ui->turns, qOverload(&QuantitySpinBox::valueChanged), this, + &TaskHelixParameters::onTurnsChanged); + connect(ui->coneAngle, qOverload(&QuantitySpinBox::valueChanged), this, + &TaskHelixParameters::onAngleChanged); + connect(ui->growth, qOverload(&QuantitySpinBox::valueChanged), this, + &TaskHelixParameters::onGrowthChanged); + connect(ui->axis, qOverload(&QComboBox::activated), this, + &TaskHelixParameters::onAxisChanged); + connect(ui->checkBoxLeftHanded, &QCheckBox::toggled, this, + &TaskHelixParameters::onLeftHandedChanged); + connect(ui->checkBoxReversed, &QCheckBox::toggled, this, + &TaskHelixParameters::onReversedChanged); + connect(ui->checkBoxUpdateView, &QCheckBox::toggled, this, + &TaskHelixParameters::onUpdateView); + connect(ui->inputMode, qOverload(&QComboBox::activated), this, + &TaskHelixParameters::onModeChanged); + connect(ui->checkBoxOutside, &QCheckBox::toggled, this, + &TaskHelixParameters::onOutsideChanged); } void TaskHelixParameters::showCoordinateAxes() @@ -462,6 +462,10 @@ void TaskHelixParameters::onAxisChanged(int num) App::PropertyLinkSub& lnk = *(axesInList[num]); if (!lnk.getValue()) { // enter reference selection mode + // assure the sketch is visible + if (auto sketch = dynamic_cast(pcHelix->Profile.getValue())) { + Gui::cmdAppObjectShow(sketch); + } TaskSketchBasedParameters::onSelectReference( AllowSelection::EDGE | AllowSelection::PLANAR |