diff --git a/src/Mod/Fem/Gui/TaskAnalysisInfo.cpp b/src/Mod/Fem/Gui/TaskAnalysisInfo.cpp index a90419d2ae..dac7bef457 100644 --- a/src/Mod/Fem/Gui/TaskAnalysisInfo.cpp +++ b/src/Mod/Fem/Gui/TaskAnalysisInfo.cpp @@ -45,28 +45,8 @@ TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis* pcObject, QWidget* parent) QMetaObject::connectSlotsByName(this); this->groupLayout()->addWidget(proxy); - - /* QObject::connect(ui->toolButton_Poly,SIGNAL(clicked()),this,SLOT(Poly())); - QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick())); - QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));*/ - } - -void TaskAnalysisInfo::SwitchMethod(int /*Value*/) -{ - /* if(Value == 1){ - ui->groupBox_AngleSearch->setEnabled(true); - ui->toolButton_Pick->setEnabled(true); - ui->toolButton_Poly->setEnabled(false); - }else{ - ui->groupBox_AngleSearch->setEnabled(false); - ui->toolButton_Pick->setEnabled(false); - ui->toolButton_Poly->setEnabled(true); - }*/ -} - - TaskAnalysisInfo::~TaskAnalysisInfo() { delete ui; diff --git a/src/Mod/Fem/Gui/TaskAnalysisInfo.h b/src/Mod/Fem/Gui/TaskAnalysisInfo.h index 2f63e814c4..5ef4fde3fe 100644 --- a/src/Mod/Fem/Gui/TaskAnalysisInfo.h +++ b/src/Mod/Fem/Gui/TaskAnalysisInfo.h @@ -58,9 +58,6 @@ public: explicit TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent = nullptr); ~TaskAnalysisInfo() override; -private Q_SLOTS: - void SwitchMethod(int Value); - protected: Fem::FemAnalysis *pcObject; diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index 4f03e68787..411406a27a 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -69,9 +69,9 @@ TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject* pcObject, QWidget* this->groupLayout()->addWidget(proxy); - QObject::connect(ui->toolButton_Poly, SIGNAL(clicked()), this, SLOT(Poly())); - QObject::connect(ui->toolButton_Pick, SIGNAL(clicked()), this, SLOT(Pick())); - QObject::connect(ui->comboBox, SIGNAL(activated(int)), this, SLOT(SwitchMethod(int))); + QObject::connect(ui->toolButton_Poly, &QToolButton::clicked, this, &TaskCreateNodeSet::Poly); + QObject::connect(ui->toolButton_Pick, &QToolButton::clicked, this, &TaskCreateNodeSet::Pick); + QObject::connect(ui->comboBox, qOverload(&QComboBox::activated), this, &TaskCreateNodeSet::SwitchMethod); // check if the Link to the FemMesh is defined assert(pcObject->FemMesh.getValue()); @@ -121,8 +121,6 @@ void TaskCreateNodeSet::SwitchMethod(int Value) } } - - void TaskCreateNodeSet::DefineNodesCallback(void* ud, SoEventCallback* n) { // show the wait cursor because this could take quite some time @@ -183,9 +181,11 @@ void TaskCreateNodeSet::onSelectionChanged(const Gui::SelectionChanges& msg) if (msg.Type == Gui::SelectionChanges::AddSelection) { std::string subName(msg.pSubName); unsigned int i = 0; - for (; i < subName.size(); i++) - if (msg.pSubName[i] == 'F') + for (; i < subName.size(); i++) { + if (msg.pSubName[i] == 'F') { break; + } + } int elem = atoi(subName.substr(4).c_str()); int face = atoi(subName.substr(i + 1).c_str()); @@ -200,14 +200,14 @@ void TaskCreateNodeSet::onSelectionChanged(const Gui::SelectionChanges& msg) std::set tmp = pcObject->FemMesh.getValue()->FemMesh.getValue().getSurfaceNodes(elem, face); tempSet.insert(tmp.begin(), tmp.end()); } - else + else { tempSet = pcObject->FemMesh.getValue()->FemMesh.getValue().getSurfaceNodes(elem, face); + } selectionMode = none; Gui::Selection().rmvSelectionGate(); MeshViewProvider->setHighlightNodes(tempSet); - } } diff --git a/src/Mod/Fem/Gui/TaskDriver.cpp b/src/Mod/Fem/Gui/TaskDriver.cpp index aa02097a3b..f2589f3159 100644 --- a/src/Mod/Fem/Gui/TaskDriver.cpp +++ b/src/Mod/Fem/Gui/TaskDriver.cpp @@ -45,24 +45,6 @@ TaskDriver::TaskDriver(Fem::FemAnalysis* pcObject, QWidget* parent) QMetaObject::connectSlotsByName(this); this->groupLayout()->addWidget(proxy); - - //QObject::connect(ui->toolButton_Poly,SIGNAL(clicked()),this,SLOT(Poly())); - //QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick())); - //QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int))); - -} - -void TaskDriver::SwitchMethod(int /*Value*/) -{ - //if(Value == 1){ - // ui->groupBox_AngleSearch->setEnabled(true); - // ui->toolButton_Pick->setEnabled(true); - // ui->toolButton_Poly->setEnabled(false); - //}else{ - // ui->groupBox_AngleSearch->setEnabled(false); - // ui->toolButton_Pick->setEnabled(false); - // ui->toolButton_Poly->setEnabled(true); - //} } TaskDriver::~TaskDriver() diff --git a/src/Mod/Fem/Gui/TaskDriver.h b/src/Mod/Fem/Gui/TaskDriver.h index d290d1f66c..e10596f785 100644 --- a/src/Mod/Fem/Gui/TaskDriver.h +++ b/src/Mod/Fem/Gui/TaskDriver.h @@ -57,10 +57,6 @@ public: explicit TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent = nullptr); ~TaskDriver() override; - -private Q_SLOTS: - void SwitchMethod(int Value); - protected: Fem::FemAnalysis *pcObject; diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.cpp b/src/Mod/Fem/Gui/TaskFemConstraint.cpp index dcd914c254..00d103a0c3 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraint.cpp @@ -78,8 +78,8 @@ TaskFemConstraint::TaskFemConstraint(ViewProviderFemConstraint *ConstraintView,Q buttonBox = new QDialogButtonBox(); buttonBox->addButton(okButton, QDialogButtonBox::AcceptRole); buttonBox->addButton(cancelButton, QDialogButtonBox::RejectRole); - QObject::connect(okButton, SIGNAL(clicked()), this, SLOT(onButtonWizOk())); - QObject::connect(cancelButton, SIGNAL(clicked()), this, SLOT(onButtonWizCancel())); + QObject::connect(okButton, &QPushButton::clicked, this, &TaskFemConstraint::onButtonWizOk); + QObject::connect(cancelButton, &QPushButton::clicked, this, &TaskFemConstraint::onButtonWizCancel); ConstraintView->wizardWidget->addWidget(buttonBox); } } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp index 7800f189f2..f1002c1a81 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp @@ -60,7 +60,7 @@ TaskFemConstraintBearing::TaskFemConstraintBearing(ViewProviderFemConstraint *Co // create a context menu for the listview of the references createDeleteAction(ui->listReferences); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintBearing::onReferenceDeleted); this->groupLayout()->addWidget(proxy); @@ -99,14 +99,14 @@ TaskFemConstraintBearing::TaskFemConstraintBearing(ViewProviderFemConstraint *Co ui->lineLocation->setText(loc); ui->checkAxial->setChecked(axialfree); - connect(ui->spinDistance, SIGNAL(valueChanged(double)), - this, SLOT(onDistanceChanged(double))); + connect(ui->spinDistance, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintBearing::onDistanceChanged); connect(ui->buttonReference, SIGNAL(pressed()), this, SLOT(onButtonReference())); connect(ui->buttonLocation, SIGNAL(pressed()), this, SLOT(onButtonLocation())); - connect(ui->checkAxial, SIGNAL(toggled(bool)), - this, SLOT(onCheckAxial(bool))); + connect(ui->checkAxial, &QCheckBox::toggled, + this, &TaskFemConstraintBearing::onCheckAxial); // Hide unwanted ui elements ui->labelDiameter->setVisible(false); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp b/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp index 33596f254c..beac27c884 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp @@ -54,22 +54,24 @@ TaskFemConstraintContact::TaskFemConstraintContact(ViewProviderFemConstraintCont QMetaObject::connectSlotsByName(this); QAction* actionSlave = new QAction(tr("Delete"), ui->lw_referencesSlave); - actionSlave->connect(actionSlave, SIGNAL(triggered()), this, SLOT(onReferenceDeletedSlave())); + connect(actionSlave, &QAction::triggered, + this, &TaskFemConstraintContact::onReferenceDeletedSlave); QAction* actionMaster = new QAction(tr("Delete"), ui->lw_referencesMaster); - actionMaster->connect(actionMaster, SIGNAL(triggered()), this, SLOT(onReferenceDeletedMaster())); + connect(actionMaster, &QAction::triggered, + this, &TaskFemConstraintContact::onReferenceDeletedMaster); ui->lw_referencesSlave->addAction(actionSlave); ui->lw_referencesSlave->setContextMenuPolicy(Qt::ActionsContextMenu); - connect(ui->lw_referencesSlave, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_referencesSlave, &QListWidget::currentItemChanged, + this, &TaskFemConstraintContact::setSelection); ui->lw_referencesMaster->addAction(actionMaster); ui->lw_referencesMaster->setContextMenuPolicy(Qt::ActionsContextMenu); - connect(ui->lw_referencesMaster, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_referencesMaster, &QListWidget::currentItemChanged, + this, &TaskFemConstraintContact::setSelection); this->groupLayout()->addWidget(proxy); @@ -104,11 +106,11 @@ TaskFemConstraintContact::TaskFemConstraintContact(ViewProviderFemConstraintCont } //Selection buttons - connect(ui->btnAddSlave, SIGNAL(clicked()), this, SLOT(addToSelectionSlave())); - connect(ui->btnRemoveSlave, SIGNAL(clicked()), this, SLOT(removeFromSelectionSlave())); + connect(ui->btnAddSlave, &QToolButton::clicked, this, &TaskFemConstraintContact::addToSelectionSlave); + connect(ui->btnRemoveSlave, &QToolButton::clicked, this, &TaskFemConstraintContact::removeFromSelectionSlave); - connect(ui->btnAddMaster, SIGNAL(clicked()), this, SLOT(addToSelectionMaster())); - connect(ui->btnRemoveMaster, SIGNAL(clicked()), this, SLOT(removeFromSelectionMaster())); + connect(ui->btnAddMaster, &QToolButton::clicked, this, &TaskFemConstraintContact::addToSelectionMaster); + connect(ui->btnRemoveMaster, &QToolButton::clicked, this, &TaskFemConstraintContact::removeFromSelectionMaster); updateUI(); } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp index b3270cbfa3..208f8bf36d 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp @@ -54,12 +54,13 @@ TaskFemConstraintDisplacement::TaskFemConstraintDisplacement(ViewProviderFemCons // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, + this, &TaskFemConstraintDisplacement::onReferenceDeleted); - connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_references, &QListWidget::currentItemChanged, + this, &TaskFemConstraintDisplacement::setSelection); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintDisplacement::setSelection); this->groupLayout()->addWidget(proxy); @@ -132,26 +133,32 @@ TaskFemConstraintDisplacement::TaskFemConstraintDisplacement(ViewProviderFemCons } // Connect decimal value inputs - connect(ui->spinxDisplacement, SIGNAL(valueChanged(double)), this, SLOT(x_changed(double))); - connect(ui->spinyDisplacement, SIGNAL(valueChanged(double)), this, SLOT(y_changed(double))); - connect(ui->spinzDisplacement, SIGNAL(valueChanged(double)), this, SLOT(z_changed(double))); - connect(ui->spinxRotation, SIGNAL(valueChanged(double)), this, SLOT(x_rot(double))); - connect(ui->spinyRotation, SIGNAL(valueChanged(double)), this, SLOT(y_rot(double))); - connect(ui->spinzRotation, SIGNAL(valueChanged(double)), this, SLOT(z_rot(double))); + connect(ui->spinxDisplacement, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintDisplacement::x_changed); + connect(ui->spinyDisplacement, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintDisplacement::y_changed); + connect(ui->spinzDisplacement, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintDisplacement::z_changed); + connect(ui->spinxRotation, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintDisplacement::x_rot); + connect(ui->spinyRotation, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintDisplacement::y_rot); + connect(ui->spinzRotation, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintDisplacement::z_rot); // Connect check box values displacements - connect(ui->dispxfix, SIGNAL(stateChanged(int)), this, SLOT(fixx(int))); - connect(ui->dispxfree, SIGNAL(stateChanged(int)), this, SLOT(freex(int))); - connect(ui->dispyfix, SIGNAL(stateChanged(int)), this, SLOT(fixy(int))); - connect(ui->dispyfree, SIGNAL(stateChanged(int)), this, SLOT(freey(int))); - connect(ui->dispzfix, SIGNAL(stateChanged(int)), this, SLOT(fixz(int))); - connect(ui->dispzfree, SIGNAL(stateChanged(int)), this, SLOT(freez(int))); + connect(ui->dispxfix, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::fixx); + connect(ui->dispxfree, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::freex); + connect(ui->dispyfix, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::fixy); + connect(ui->dispyfree, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::freey); + connect(ui->dispzfix, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::fixz); + connect(ui->dispzfree, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::freez); // Connect to check box values for rotations - connect(ui->rotxfix, SIGNAL(stateChanged(int)), this, SLOT(rotfixx(int))); - connect(ui->rotxfree, SIGNAL(stateChanged(int)), this, SLOT(rotfreex(int))); - connect(ui->rotyfix, SIGNAL(stateChanged(int)), this, SLOT(rotfixy(int))); - connect(ui->rotyfree, SIGNAL(stateChanged(int)), this, SLOT(rotfreey(int))); - connect(ui->rotzfix, SIGNAL(stateChanged(int)), this, SLOT(rotfixz(int))); - connect(ui->rotzfree, SIGNAL(stateChanged(int)), this, SLOT(rotfreez(int))); + connect(ui->rotxfix, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::rotfixx); + connect(ui->rotxfree, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::rotfreex); + connect(ui->rotyfix, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::rotfixy); + connect(ui->rotyfree, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::rotfreey); + connect(ui->rotzfix, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::rotfixz); + connect(ui->rotzfree, &QCheckBox::stateChanged, this, &TaskFemConstraintDisplacement::rotfreez); //Selection buttons buttonGroup->addButton(ui->btnAdd, (int)SelectionChangeModes::refAdd); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp index eb392c88ac..b2f52f2cd6 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp @@ -53,12 +53,12 @@ TaskFemConstraintFixed::TaskFemConstraintFixed(ViewProviderFemConstraintFixed* C // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); - - connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(deleteAction, &QAction::triggered, + this, &TaskFemConstraintFixed::onReferenceDeleted); + connect(ui->lw_references, &QListWidget::currentItemChanged, + this, &TaskFemConstraintFixed::setSelection); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintFixed::setSelection); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 08e970df60..9073b057a6 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -119,7 +119,8 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo // create a context menu for the listview of the references createDeleteAction(ui->listReferences); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, + this, &TaskFemConstraintFluidBoundary::onReferenceDeleted); // setup ranges ui->spinBoundaryValue->setMinimum(-FLOAT_MAX); @@ -135,25 +136,25 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo ui->spinHTCoeffValue->setMinimum(0.0); ui->spinHTCoeffValue->setMaximum(FLOAT_MAX); - connect(ui->comboBoundaryType, SIGNAL(currentIndexChanged(int)), - this, SLOT(onBoundaryTypeChanged(void))); - connect(ui->comboSubtype, SIGNAL(currentIndexChanged(int)), - this, SLOT(onSubtypeChanged(void))); - connect(ui->spinBoundaryValue, SIGNAL(valueChanged(double)), - this, SLOT(onBoundaryValueChanged(double))); + connect(ui->comboBoundaryType, qOverload(&QComboBox::currentIndexChanged), + this, &TaskFemConstraintFluidBoundary::onBoundaryTypeChanged); + connect(ui->comboSubtype, qOverload(&QComboBox::currentIndexChanged), + this, &TaskFemConstraintFluidBoundary::onSubtypeChanged); + connect(ui->spinBoundaryValue, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintFluidBoundary::onBoundaryValueChanged); - connect(ui->comboTurbulenceSpecification, SIGNAL(currentIndexChanged(int)), - this, SLOT(onTurbulenceSpecificationChanged(void))); - connect(ui->comboThermalBoundaryType, SIGNAL(currentIndexChanged(int)), - this, SLOT(onThermalBoundaryTypeChanged(void))); + connect(ui->comboTurbulenceSpecification, qOverload(&QComboBox::currentIndexChanged), + this, &TaskFemConstraintFluidBoundary::onTurbulenceSpecificationChanged); + connect(ui->comboThermalBoundaryType, qOverload(&QComboBox::currentIndexChanged), + this, &TaskFemConstraintFluidBoundary::onThermalBoundaryTypeChanged); connect(ui->buttonDirection, SIGNAL(pressed()), this, SLOT(onButtonDirection())); - connect(ui->checkReverse, SIGNAL(toggled(bool)), - this, SLOT(onCheckReverse(bool))); + connect(ui->checkReverse, &QCheckBox::toggled, + this, &TaskFemConstraintFluidBoundary::onCheckReverse); - connect(ui->listReferences, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->listReferences, &QListWidget::itemClicked, + this, &TaskFemConstraintFluidBoundary::setSelection); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index a7ac51b01b..3a50e39ecf 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -60,14 +60,14 @@ TaskFemConstraintForce::TaskFemConstraintForce(ViewProviderFemConstraintForce* C createDeleteAction(ui->listReferences); deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); - connect(ui->spinForce, SIGNAL(valueChanged(double)), - this, SLOT(onForceChanged(double))); - connect(ui->buttonDirection, SIGNAL(clicked(bool)), - this, SLOT(onButtonDirection(bool))); - connect(ui->checkReverse, SIGNAL(toggled(bool)), - this, SLOT(onCheckReverse(bool))); - connect(ui->listReferences, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->spinForce, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskFemConstraintForce::onForceChanged); + connect(ui->buttonDirection, &QToolButton::clicked, + this, &TaskFemConstraintForce::onButtonDirection); + connect(ui->checkReverse, &QCheckBox::toggled, + this, &TaskFemConstraintForce::onCheckReverse); + connect(ui->listReferences, &QListWidget::itemClicked, + this, &TaskFemConstraintForce::setSelection); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp index f3a8655efa..59f8b766a6 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp @@ -48,16 +48,16 @@ using namespace Gui; TaskFemConstraintGear::TaskFemConstraintGear(ViewProviderFemConstraint *ConstraintView,QWidget *parent, const char *pixmapname) : TaskFemConstraintBearing(ConstraintView, parent, pixmapname) { - connect(ui->spinDiameter, SIGNAL(valueChanged(double)), - this, SLOT(onDiameterChanged(double))); - connect(ui->spinForce, SIGNAL(valueChanged(double)), - this, SLOT(onForceChanged(double))); - connect(ui->spinForceAngle, SIGNAL(valueChanged(double)), - this, SLOT(onForceAngleChanged(double))); + connect(ui->spinDiameter, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintGear::onDiameterChanged); + connect(ui->spinForce, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintGear::onForceChanged); + connect(ui->spinForceAngle, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintGear::onForceAngleChanged); connect(ui->buttonDirection, SIGNAL(pressed()), this, SLOT(onButtonDirection())); - connect(ui->checkReversed, SIGNAL(toggled(bool)), - this, SLOT(onCheckReversed(bool))); + connect(ui->checkReversed, &QCheckBox::toggled, + this, &TaskFemConstraintGear::onCheckReversed); // Temporarily prevent unnecessary feature recomputes ui->spinDiameter->blockSignals(true); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp index e7524966df..2becfd32ee 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp @@ -54,21 +54,21 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(ViewProviderFemConstraintHe // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintHeatflux::onReferenceDeleted); - connect(ui->rb_convection, SIGNAL(clicked(bool)), this, SLOT(Conv())); - connect(ui->rb_dflux, SIGNAL(clicked(bool)), this, SLOT(Flux())); + connect(ui->rb_convection, &QRadioButton::clicked, + this, &TaskFemConstraintHeatflux::Conv); + connect(ui->rb_dflux, &QRadioButton::clicked, + this, &TaskFemConstraintHeatflux::Flux); - connect(ui->if_heatflux, SIGNAL(valueChanged(double)), - this, SLOT(onHeatFluxChanged(double))); - connect(ui->if_ambienttemp, SIGNAL(valueChanged(double)), - this, SLOT(onAmbientTempChanged(double))); - //connect(ui->if_facetemp, SIGNAL(valueChanged(double)), - // this, SLOT(onFaceTempChanged(double))); - connect(ui->if_filmcoef, SIGNAL(valueChanged(double)), - this, SLOT(onFilmCoefChanged(double))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->if_heatflux, qOverload(&InputField::valueChanged), + this, &TaskFemConstraintHeatflux::onHeatFluxChanged); + connect(ui->if_ambienttemp, qOverload(&InputField::valueChanged), + this, &TaskFemConstraintHeatflux::onAmbientTempChanged); + connect(ui->if_filmcoef, qOverload(&InputField::valueChanged), + this, &TaskFemConstraintHeatflux::onFilmCoefChanged); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintHeatflux::setSelection); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp index fbe18818e3..a88e72eac7 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp @@ -59,12 +59,12 @@ TaskFemConstraintPlaneRotation::TaskFemConstraintPlaneRotation(ViewProviderFemCo // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintPlaneRotation::onReferenceDeleted); - connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_references, &QListWidget::currentItemChanged, + this, &TaskFemConstraintPlaneRotation::setSelection); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintPlaneRotation::setSelection); this->groupLayout()->addWidget(proxy); @@ -86,8 +86,8 @@ TaskFemConstraintPlaneRotation::TaskFemConstraintPlaneRotation(ViewProviderFemCo } //Selection buttons - connect(ui->btnAdd, SIGNAL(clicked()), this, SLOT(addToSelection())); - connect(ui->btnRemove, SIGNAL(clicked()), this, SLOT(removeFromSelection())); + connect(ui->btnAdd, &QToolButton::clicked, this, &TaskFemConstraintPlaneRotation::addToSelection); + connect(ui->btnRemove, &QToolButton::clicked, this, &TaskFemConstraintPlaneRotation::removeFromSelection); updateUI(); } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp index 512438772a..6010302d15 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp @@ -52,15 +52,15 @@ TaskFemConstraintPressure::TaskFemConstraintPressure(ViewProviderFemConstraintPr // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintPressure::onReferenceDeleted); - connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_references, &QListWidget::currentItemChanged, + this, &TaskFemConstraintPressure::setSelection); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintPressure::setSelection); - connect(ui->checkBoxReverse, SIGNAL(toggled(bool)), - this, SLOT(onCheckReverse(bool))); + connect(ui->checkBoxReverse, &QCheckBox::toggled, + this, &TaskFemConstraintPressure::onCheckReverse); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp index a6585da106..ec0d9b6d8d 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp @@ -43,14 +43,14 @@ using namespace Gui; TaskFemConstraintPulley::TaskFemConstraintPulley(ViewProviderFemConstraintPulley* ConstraintView, QWidget* parent) : TaskFemConstraintGear(ConstraintView, parent, "FEM_ConstraintPulley") { - connect(ui->spinOtherDiameter, SIGNAL(valueChanged(double)), - this, SLOT(onOtherDiameterChanged(double))); - connect(ui->spinCenterDistance, SIGNAL(valueChanged(double)), - this, SLOT(onCenterDistanceChanged(double))); - connect(ui->checkIsDriven, SIGNAL(toggled(bool)), - this, SLOT(onCheckIsDriven(bool))); - connect(ui->spinTensionForce, SIGNAL(valueChanged(double)), - this, SLOT(onTensionForceChanged(double))); + connect(ui->spinOtherDiameter, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintPulley::onOtherDiameterChanged); + connect(ui->spinCenterDistance, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintPulley::onCenterDistanceChanged); + connect(ui->checkIsDriven, &QCheckBox::toggled, + this, &TaskFemConstraintPulley::onCheckIsDriven); + connect(ui->spinTensionForce, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskFemConstraintPulley::onTensionForceChanged); // Temporarily prevent unnecessary feature recomputes ui->spinOtherDiameter->blockSignals(true); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp b/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp index 94abe5e0fa..aea6b0b88e 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp @@ -52,12 +52,12 @@ TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintSpring::onReferenceDeleted); - connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_references, &QListWidget::currentItemChanged, + this, &TaskFemConstraintSpring::setSelection); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintSpring::setSelection); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp index dfac163f60..e839b01a64 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp @@ -55,17 +55,20 @@ TaskFemConstraintTemperature::TaskFemConstraintTemperature(ViewProviderFemConstr // create a context menu for the listview of the references createDeleteAction(ui->lw_references); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, + this, &TaskFemConstraintTemperature::onReferenceDeleted); - connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_references, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->rb_temperature, SIGNAL(clicked(bool)), this, SLOT(Temp())); - connect(ui->rb_cflux, SIGNAL(clicked(bool)), this, SLOT(Flux())); + connect(ui->lw_references, &QListWidget::currentItemChanged, + this, &TaskFemConstraintTemperature::setSelection); + connect(ui->lw_references, &QListWidget::itemClicked, + this, &TaskFemConstraintTemperature::setSelection); + connect(ui->rb_temperature, &QRadioButton::clicked, + this, &TaskFemConstraintTemperature::Temp); + connect(ui->rb_cflux, &QRadioButton::clicked, + this, &TaskFemConstraintTemperature::Flux); - connect(ui->if_temperature, SIGNAL(valueChanged(double)), - this, SLOT(onTempCfluxChanged(double))); + connect(ui->if_temperature, qOverload(&InputField::valueChanged), + this, &TaskFemConstraintTemperature::onTempCfluxChanged); this->groupLayout()->addWidget(proxy); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp index 7fe0f70b06..d8615e273e 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp @@ -58,26 +58,29 @@ TaskFemConstraintTransform::TaskFemConstraintTransform(ViewProviderFemConstraint // create a context menu for the listview of the references createDeleteAction(ui->lw_Rect); - deleteAction->connect(deleteAction, SIGNAL(triggered()), this, SLOT(onReferenceDeleted())); + connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintTransform::onReferenceDeleted); // highlight seletcted list items in the model - connect(ui->lw_Rect, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_Rect, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_displobj_rect, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); - connect(ui->lw_displobj_rect, SIGNAL(itemClicked(QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_Rect, &QListWidget::currentItemChanged, + this, &TaskFemConstraintTransform::setSelection); + connect(ui->lw_Rect, &QListWidget::itemClicked, + this, &TaskFemConstraintTransform::setSelection); + connect(ui->lw_displobj_rect, &QListWidget::currentItemChanged, + this, &TaskFemConstraintTransform::setSelection); + connect(ui->lw_displobj_rect, &QListWidget::itemClicked, + this, &TaskFemConstraintTransform::setSelection); this->groupLayout()->addWidget(proxy); - connect(ui->rb_rect, SIGNAL(clicked(bool)), this, SLOT(Rect())); - connect(ui->rb_cylin, SIGNAL(clicked(bool)), this, SLOT(Cyl())); + connect(ui->rb_rect, &QRadioButton::clicked, this, &TaskFemConstraintTransform::Rect); + connect(ui->rb_cylin, &QRadioButton::clicked, this, &TaskFemConstraintTransform::Cyl); - connect(ui->sp_X, SIGNAL(valueChanged(int)), this, SLOT(x_Changed(int))); - connect(ui->sp_Y, SIGNAL(valueChanged(int)), this, SLOT(y_Changed(int))); - connect(ui->sp_Z, SIGNAL(valueChanged(int)), this, SLOT(z_Changed(int))); + connect(ui->sp_X, qOverload(&QSpinBox::valueChanged), + this, &TaskFemConstraintTransform::x_Changed); + connect(ui->sp_Y, qOverload(&QSpinBox::valueChanged), + this, &TaskFemConstraintTransform::y_Changed); + connect(ui->sp_Z, qOverload(&QSpinBox::valueChanged), + this, &TaskFemConstraintTransform::z_Changed); // Get the feature data Fem::ConstraintTransform* pcConstraint = static_cast(ConstraintView->getObject()); @@ -133,8 +136,8 @@ TaskFemConstraintTransform::TaskFemConstraintTransform(ViewProviderFemConstraint } } //Selection buttons - connect(ui->btnAdd, SIGNAL(clicked()), this, SLOT(addToSelection())); - connect(ui->btnRemove, SIGNAL(clicked()), this, SLOT(removeFromSelection())); + connect(ui->btnAdd, &QToolButton::clicked, this, &TaskFemConstraintTransform::addToSelection); + connect(ui->btnRemove, &QToolButton::clicked, this, &TaskFemConstraintTransform::removeFromSelection); updateUI(); if ((p == 0) && (!Objects.empty())) { @@ -288,15 +291,15 @@ void TaskFemConstraintTransform::addToSelection() } } if (addMe) { - disconnect(ui->lw_Rect, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + disconnect(ui->lw_Rect, &QListWidget::currentItemChanged, + this, &TaskFemConstraintTransform::setSelection); for (std::size_t i = 0; i < ObjDispl.size(); i++) { if ((makeRefText(ObjDispl[i], SubElemDispl[i])) == (makeRefText(obj, subNames[subIt]))) { Objects.push_back(obj); SubElements.push_back(subNames[subIt]); ui->lw_Rect->addItem(makeRefText(obj, subNames[subIt])); - connect(ui->lw_Rect, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), - this, SLOT(setSelection(QListWidgetItem*))); + connect(ui->lw_Rect, &QListWidget::currentItemChanged, + this, &TaskFemConstraintTransform::setSelection); } } if (Objects.empty()) { diff --git a/src/Mod/Fem/Gui/TaskObjectName.cpp b/src/Mod/Fem/Gui/TaskObjectName.cpp index f5e6370735..06e2b9a39e 100644 --- a/src/Mod/Fem/Gui/TaskObjectName.cpp +++ b/src/Mod/Fem/Gui/TaskObjectName.cpp @@ -52,9 +52,9 @@ TaskObjectName::TaskObjectName(App::DocumentObject *pcObject,QWidget *parent) this->groupLayout()->addWidget(proxy); - QObject::connect(ui->lineEdit_ObjectName,SIGNAL(textChanged (const QString&)),this,SLOT(TextChanged(const QString&))); + QObject::connect(ui->lineEdit_ObjectName, &QLineEdit::textChanged, this, &TaskObjectName::TextChanged); - if(strcmp(pcObject->Label.getValue(),"") != 0) + if (strcmp(pcObject->Label.getValue(),"") != 0) ui->lineEdit_ObjectName->setText(QString::fromUtf8(pcObject->Label.getValue())); else ui->lineEdit_ObjectName->setText(QString::fromLatin1(pcObject->getNameInDocument())); diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 14b383d983..80ec4ce596 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -655,13 +655,20 @@ TaskPostDataAlongLine::TaskPostDataAlongLine(ViewProviderDocumentObject* view, Q int res = static_cast(getObject())->Resolution.getValue(); ui->resolution->setValue(res); - connect(ui->point1X, SIGNAL(valueChanged(double)), this, SLOT(point1Changed(double))); - connect(ui->point1Y, SIGNAL(valueChanged(double)), this, SLOT(point1Changed(double))); - connect(ui->point1Z, SIGNAL(valueChanged(double)), this, SLOT(point1Changed(double))); - connect(ui->point2X, SIGNAL(valueChanged(double)), this, SLOT(point2Changed(double))); - connect(ui->point2Y, SIGNAL(valueChanged(double)), this, SLOT(point2Changed(double))); - connect(ui->point2Z, SIGNAL(valueChanged(double)), this, SLOT(point2Changed(double))); - connect(ui->resolution, SIGNAL(valueChanged(int)), this, SLOT(resolutionChanged(int))); + connect(ui->point1X, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAlongLine::point1Changed); + connect(ui->point1Y, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAlongLine::point1Changed); + connect(ui->point1Z, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAlongLine::point1Changed); + connect(ui->point2X, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAlongLine::point2Changed); + connect(ui->point2Y, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAlongLine::point2Changed); + connect(ui->point2Z, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAlongLine::point2Changed); + connect(ui->resolution, qOverload(&QSpinBox::valueChanged), + this, &TaskPostDataAlongLine::resolutionChanged); //update all fields updateEnumerationList(getTypedView()->DisplayMode, ui->Representation); @@ -717,8 +724,8 @@ void TaskPostDataAlongLine::on_SelectPoints_clicked() { FemGui::PointMarker* marker = new FemGui::PointMarker(viewer, ObjName); viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), FemGui::TaskPostDataAlongLine::pointCallback, marker); - connect(marker, SIGNAL(PointsChanged(double, double, double, double, double, double)), this, - SLOT(onChange(double, double, double, double, double, double))); + connect(marker, &PointMarker::PointsChanged, + this, &TaskPostDataAlongLine::onChange); } } @@ -944,9 +951,12 @@ TaskPostDataAtPoint::TaskPostDataAtPoint(ViewProviderDocumentObject* view, QWidg auto pointValue = static_cast(getObject())->PointData[0]; showValue(pointValue, static_cast(getObject())->Unit.getValue()); - connect(ui->centerX, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double))); - connect(ui->centerY, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double))); - connect(ui->centerZ, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double))); + connect(ui->centerX, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAtPoint::centerChanged); + connect(ui->centerY, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAtPoint::centerChanged); + connect(ui->centerZ, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &TaskPostDataAtPoint::centerChanged); // the point filter object needs to be recomputed // to fill all fields with data at the current point @@ -1003,7 +1013,7 @@ void TaskPostDataAtPoint::on_SelectPoint_clicked() { FemGui::DataMarker* marker = new FemGui::DataMarker(viewer, ObjName); viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), FemGui::TaskPostDataAtPoint::pointCallback, marker); - connect(marker, SIGNAL(PointsChanged(double, double, double)), this, SLOT(onChange(double, double, double))); + connect(marker, &DataMarker::PointsChanged, this, &TaskPostDataAtPoint::onChange); } getTypedView()->DisplayMode.setValue(1); updateEnumerationList(getTypedView()->Field, ui->Field); diff --git a/src/Mod/Fem/Gui/TaskTetParameter.cpp b/src/Mod/Fem/Gui/TaskTetParameter.cpp index 27b7725c0e..569f1e36a6 100644 --- a/src/Mod/Fem/Gui/TaskTetParameter.cpp +++ b/src/Mod/Fem/Gui/TaskTetParameter.cpp @@ -59,12 +59,17 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg ui->spinBox_SegsPerRadius->setValue(pcObject->NbSegsPerRadius.getValue()); ui->checkBox_Optimize->setChecked(pcObject->Optimize.getValue()); - QObject::connect(ui->doubleSpinBox_MaxSize,SIGNAL(valueChanged(double)),this,SLOT(maxSizeValueChanged(double))); - QObject::connect(ui->comboBox_Fineness,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int))); + QObject::connect(ui->doubleSpinBox_MaxSize, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskTetParameter::maxSizeValueChanged); + QObject::connect(ui->comboBox_Fineness, qOverload(&QComboBox::activated), + this, &TaskTetParameter::SwitchMethod); QObject::connect(ui->checkBox_SecondOrder,SIGNAL(stateChanged (int)),this,SLOT(setQuadric(int))); - QObject::connect(ui->doubleSpinBox_GrowthRate,SIGNAL(valueChanged(double)),this,SLOT(setGrowthRate(double))); - QObject::connect(ui->spinBox_SegsPerEdge,SIGNAL(valueChanged (int)),this,SLOT(setSegsPerEdge(int))); - QObject::connect(ui->spinBox_SegsPerRadius,SIGNAL(valueChanged (int)),this,SLOT(setSegsPerRadius(int))); + QObject::connect(ui->doubleSpinBox_GrowthRate, qOverload(&QDoubleSpinBox::valueChanged), + this, &TaskTetParameter::setGrowthRate); + QObject::connect(ui->spinBox_SegsPerEdge, qOverload(&QSpinBox::valueChanged), + this, &TaskTetParameter::setSegsPerEdge); + QObject::connect(ui->spinBox_SegsPerRadius, qOverload(&QSpinBox::valueChanged), + this, &TaskTetParameter::setSegsPerRadius); QObject::connect(ui->checkBox_Optimize,SIGNAL(stateChanged (int)),this,SLOT(setOptimize(int))); if(pcObject->FemMesh.getValue().getInfo().numNode == 0) diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp index 71cd818cbf..565b56fbc0 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.cpp @@ -510,12 +510,12 @@ PlaneWidget::PlaneWidget() { ui->normalY->setDecimals(UserDecimals); ui->normalZ->setDecimals(UserDecimals); - connect(ui->originX, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double))); - connect(ui->originY, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double))); - connect(ui->originZ, SIGNAL(valueChanged(double)), this, SLOT(originChanged(double))); - connect(ui->normalX, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double))); - connect(ui->normalY, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double))); - connect(ui->normalZ, SIGNAL(valueChanged(double)), this, SLOT(normalChanged(double))); + connect(ui->originX, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &PlaneWidget::originChanged); + connect(ui->originY, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &PlaneWidget::originChanged); + connect(ui->originZ, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &PlaneWidget::originChanged); + connect(ui->normalX, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &PlaneWidget::normalChanged); + connect(ui->normalY, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &PlaneWidget::normalChanged); + connect(ui->normalZ, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &PlaneWidget::normalChanged); } PlaneWidget::~PlaneWidget() { @@ -686,10 +686,10 @@ SphereWidget::SphereWidget() { ui->centerY->setDecimals(UserDecimals); ui->centerZ->setDecimals(UserDecimals); - connect(ui->centerX, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double))); - connect(ui->centerY, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double))); - connect(ui->centerZ, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double))); - connect(ui->radius, SIGNAL(valueChanged(double)), this, SLOT(radiusChanged(double))); + connect(ui->centerX, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &SphereWidget::centerChanged); + connect(ui->centerY, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &SphereWidget::centerChanged); + connect(ui->centerZ, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &SphereWidget::centerChanged); + connect(ui->radius, qOverload(&Gui::QuantitySpinBox::valueChanged), this, &SphereWidget::radiusChanged); } SphereWidget::~SphereWidget() {