diff --git a/src/Gui/Control.cpp b/src/Gui/Control.cpp index f911e541dc..83e1b4084e 100644 --- a/src/Gui/Control.cpp +++ b/src/Gui/Control.cpp @@ -132,7 +132,8 @@ void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg) if (ActiveDialog == dlg) return; // dialog is already defined ActiveDialog = dlg; - connect(dlg, SIGNAL(aboutToBeDestroyed()), this, SLOT(closedDialog())); + connect(dlg, &TaskView::TaskDialog::aboutToBeDestroyed, + this, &ControlSingleton::closedDialog); } // not all workbenches have the combo view enabled else if (!_taskPanel) { @@ -143,7 +144,7 @@ void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg) dw->setWidget(_taskPanel); _taskPanel->showDialog(dlg); getMainWindow()->addDockWidget(Qt::LeftDockWidgetArea, dw); - connect(dlg, SIGNAL(destroyed()), dw, SLOT(deleteLater())); + connect(dlg, &TaskView::TaskDialog::destroyed, dw, &ControlSingleton::deleteLater); // if we have the normal tree view available then just tabify with it QWidget* treeView = Gui::DockWindowManager::instance()->getDockWindow("Tree view"); diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp index 3332ce73cf..c4ec81da6a 100644 --- a/src/Gui/DAGView/DAGModel.cpp +++ b/src/Gui/DAGView/DAGModel.cpp @@ -134,8 +134,8 @@ Model::Model(QObject *parentIn, const Gui::Document &documentIn) : QGraphicsScen editingFinishedAction = new QAction(this); editingFinishedAction->setText(tr("Finish editing")); editingFinishedAction->setStatusTip(tr("Finish editing object")); - connect(this->editingFinishedAction, SIGNAL(triggered()), - this, SLOT(editingFinishedSlot())); + connect(this->editingFinishedAction, &QAction::triggered, + this, &Model::editingFinishedSlot); connectNewObject = documentIn.signalNewObject.connect(boost::bind(&Model::slotNewObject, this, bp::_1)); connectDelObject = documentIn.signalDeletedObject.connect(boost::bind(&Model::slotDeleteObject, this, bp::_1)); diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index 3b4457497b..9db1fe01c2 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -104,10 +104,9 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl ) if (ui->parameterSet->count() < 2) ui->parameterSet->hide(); - connect(ui->parameterSet, SIGNAL(activated(int)), - this, SLOT(onChangeParameterSet(int))); - connect(paramGroup, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), - this, SLOT(onGroupSelected(QTreeWidgetItem*))); + connect(ui->parameterSet, qOverload(&QComboBox::activated), + this, &DlgParameterImp::onChangeParameterSet); + connect(paramGroup, &QTreeWidget::currentItemChanged, this, &DlgParameterImp::onGroupSelected); onGroupSelected(paramGroup->currentItem()); // setup for function on_findGroup_changed: diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp index 93c9423d63..4bcb3ad5ab 100644 --- a/src/Gui/DlgSettings3DViewImp.cpp +++ b/src/Gui/DlgSettings3DViewImp.cpp @@ -119,8 +119,8 @@ void DlgSettings3DViewImp::loadSettings() index = Base::clamp(index, 0, ui->comboAliasing->count()-1); ui->comboAliasing->setCurrentIndex(index); // connect after setting current item of the combo box - connect(ui->comboAliasing, SIGNAL(currentIndexChanged(int)), - this, SLOT(onAliasingChanged(int))); + connect(ui->comboAliasing, qOverload(&QComboBox::currentIndexChanged), + this, &DlgSettings3DViewImp::onAliasingChanged); index = hGrp->GetInt("RenderCache", 0); ui->renderCache->setCurrentIndex(index); diff --git a/src/Gui/DlgSettingsDocumentImp.cpp b/src/Gui/DlgSettingsDocumentImp.cpp index 08a50a67f4..17f24da5bb 100644 --- a/src/Gui/DlgSettingsDocumentImp.cpp +++ b/src/Gui/DlgSettingsDocumentImp.cpp @@ -54,7 +54,8 @@ DlgSettingsDocumentImp::DlgSettingsDocumentImp( QWidget* parent ) ui->prefCountBackupFiles->setMaximum(INT_MAX); ui->prefCompression->setMinimum(Z_NO_COMPRESSION); ui->prefCompression->setMaximum(Z_BEST_COMPRESSION); - connect( ui->prefLicenseType, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseTypeChanged(int)) ); + connect(ui->prefLicenseType, qOverload(&QComboBox::currentIndexChanged), + this, &DlgSettingsDocumentImp::onLicenseTypeChanged); } /** diff --git a/src/Gui/DlgUnitsCalculatorImp.cpp b/src/Gui/DlgUnitsCalculatorImp.cpp index de783e19bc..5062e388e4 100644 --- a/src/Gui/DlgUnitsCalculatorImp.cpp +++ b/src/Gui/DlgUnitsCalculatorImp.cpp @@ -58,14 +58,13 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl ) } connect(ui->ValueInput, SIGNAL(valueChanged(Base::Quantity)), this, SLOT(valueChanged(Base::Quantity))); - connect(ui->ValueInput, SIGNAL(returnPressed()), this, SLOT(returnPressed())); - connect(ui->UnitInput, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); - connect(ui->UnitInput, SIGNAL(returnPressed()), this, SLOT(returnPressed())); - - connect(ui->pushButton_Close, SIGNAL(clicked()), this, SLOT(accept())); - connect(ui->pushButton_Copy, SIGNAL(clicked()), this, SLOT(copy())); - - connect(ui->ValueInput, SIGNAL(parseError(QString)), this, SLOT(parseError(QString))); + connect(ui->ValueInput, &InputField::returnPressed, + this, &DlgUnitsCalculator::returnPressed); + connect(ui->ValueInput, &InputField::parseError, this, &DlgUnitsCalculator::parseError); + connect(ui->UnitInput, &QLineEdit::textChanged, this, &DlgUnitsCalculator::textChanged); + connect(ui->UnitInput, &QLineEdit::returnPressed, this, &DlgUnitsCalculator::returnPressed); + connect(ui->pushButton_Close, &QPushButton::clicked, this, &DlgUnitsCalculator::accept); + connect(ui->pushButton_Copy, &QPushButton::clicked, this, &DlgUnitsCalculator::copy); ui->ValueInput->setParamGrpPath(QByteArray("User parameter:BaseApp/History/UnitsCalculator")); // set a default that also illustrates how the dialog works diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 0362fc51dc..e152d5cdd7 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -954,8 +954,7 @@ void PythonConsole::changeEvent(QEvent *e) if (e->type() == QEvent::ParentChange) { auto dw = qobject_cast(this->parentWidget()); if (dw) { - connect(dw, SIGNAL(visibilityChanged(bool)), - this, SLOT(visibilityChanged(bool))); + connect(dw, &QDockWidget::visibilityChanged, this, &PythonConsole::visibilityChanged); } } else if (e->type() == QEvent::StyleChange) { diff --git a/src/Gui/PythonEditor.cpp b/src/Gui/PythonEditor.cpp index 0d105c00b1..61a58f4f9c 100644 --- a/src/Gui/PythonEditor.cpp +++ b/src/Gui/PythonEditor.cpp @@ -78,10 +78,8 @@ PythonEditor::PythonEditor(QWidget* parent) auto uncomment = new QShortcut(this); uncomment->setKey(QKeySequence(QString::fromLatin1("ALT+U"))); - connect(comment, SIGNAL(activated()), - this, SLOT(onComment())); - connect(uncomment, SIGNAL(activated()), - this, SLOT(onUncomment())); + connect(comment, &QShortcut::activated, this, &PythonEditor::onComment); + connect(uncomment, &QShortcut::activated, this, &PythonEditor::onUncomment); } /** Destroys the object and frees any allocated resources */