From 7ccee344c7a42da0d288a1022c815488ae1375d0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 13 Jan 2023 20:17:53 +0100 Subject: [PATCH] Sketcher: move to new style connect() --- src/Mod/Sketcher/Gui/EditDatumDialog.cpp | 12 ++++++---- .../Sketcher/Gui/SketchOrientationDialog.cpp | 8 +++---- src/Mod/Sketcher/Gui/SketcherSettings.cpp | 2 +- src/Mod/Sketcher/Gui/TaskSketcherElements.cpp | 4 ++-- src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp | 24 +++++++++---------- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp index daa866d03d..e35a6414ac 100644 --- a/src/Mod/Sketcher/Gui/EditDatumDialog.cpp +++ b/src/Mod/Sketcher/Gui/EditDatumDialog.cpp @@ -140,11 +140,13 @@ void EditDatumDialog::exec(bool atCursor) ui_ins_datum->cbDriving->setChecked(! Constr->isDriving); - connect(ui_ins_datum->cbDriving, SIGNAL(toggled(bool)), this, SLOT(drivingToggled(bool))); - connect(ui_ins_datum->labelEdit, SIGNAL(valueChanged(const Base::Quantity&)), this, SLOT(datumChanged())); - connect(ui_ins_datum->labelEdit, SIGNAL(showFormulaDialog(bool)), this, SLOT(formEditorOpened(bool))); - connect(&dlg, SIGNAL(accepted()), this, SLOT(accepted())); - connect(&dlg, SIGNAL(rejected()), this, SLOT(rejected())); + connect(ui_ins_datum->cbDriving, &QCheckBox::toggled, this, &EditDatumDialog::drivingToggled); + connect(ui_ins_datum->labelEdit, qOverload(&Gui::QuantitySpinBox::valueChanged), + this, &EditDatumDialog::datumChanged); + connect(ui_ins_datum->labelEdit, &Gui::QuantitySpinBox::showFormulaDialog, + this, &EditDatumDialog::formEditorOpened); + connect(&dlg, &QDialog::accepted, this, &EditDatumDialog::accepted); + connect(&dlg, &QDialog::rejected, this, &EditDatumDialog::rejected); if (atCursor) { dlg.show(); // Need to show the dialog so geometry is computed diff --git a/src/Mod/Sketcher/Gui/SketchOrientationDialog.cpp b/src/Mod/Sketcher/Gui/SketchOrientationDialog.cpp index 6b1f2ba8d7..7c7469b672 100644 --- a/src/Mod/Sketcher/Gui/SketchOrientationDialog.cpp +++ b/src/Mod/Sketcher/Gui/SketchOrientationDialog.cpp @@ -41,10 +41,10 @@ SketchOrientationDialog::SketchOrientationDialog() ui->setupUi(this); onPreview(); - connect(ui->Reverse_checkBox, SIGNAL(clicked(bool)), this, SLOT(onPreview())); - connect(ui->XY_radioButton , SIGNAL(clicked(bool)), this, SLOT(onPreview())); - connect(ui->XZ_radioButton , SIGNAL(clicked(bool)), this, SLOT(onPreview())); - connect(ui->YZ_radioButton , SIGNAL(clicked(bool)), this, SLOT(onPreview())); + connect(ui->Reverse_checkBox, &QCheckBox::clicked, this, &SketchOrientationDialog::onPreview); + connect(ui->XY_radioButton , &QRadioButton::clicked, this, &SketchOrientationDialog::onPreview); + connect(ui->XZ_radioButton , &QRadioButton::clicked, this, &SketchOrientationDialog::onPreview); + connect(ui->YZ_radioButton , &QRadioButton::clicked, this, &SketchOrientationDialog::onPreview); } SketchOrientationDialog::~SketchOrientationDialog() diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.cpp b/src/Mod/Sketcher/Gui/SketcherSettings.cpp index 721f8411fc..6cfdda8bb1 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.cpp +++ b/src/Mod/Sketcher/Gui/SketcherSettings.cpp @@ -131,7 +131,7 @@ SketcherSettingsDisplay::SketcherSettingsDisplay(QWidget* parent) ui->comboBox->addItem(QIcon(px), QString(), QVariant(it->second)); } - connect(ui->btnTVApply, SIGNAL(clicked(bool)), this, SLOT(onBtnTVApplyClicked(bool))); + connect(ui->btnTVApply, &QPushButton::clicked, this, &SketcherSettingsDisplay::onBtnTVApplyClicked); } /** diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp index 78f39c4948..499a6a8db8 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -257,8 +257,8 @@ ElementView::ElementView(QWidget *parent) : QListWidget(parent) setItemDelegate(elementItemDelegate); QObject::connect( - elementItemDelegate, SIGNAL(itemHovered(QModelIndex)), - this, SLOT(onIndexHovered(QModelIndex)) + elementItemDelegate, &ElementItemDelegate::itemHovered, + this, &ElementView::onIndexHovered ); } diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp index f68949bf2f..2c28ec0a75 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp @@ -207,33 +207,33 @@ TaskSketcherGeneral::TaskSketcherGeneral(ViewProviderSketch *sketchView) // connecting the needed signals QObject::connect( - widget, SIGNAL(emitToggleGridView(bool)), - this , SLOT (onToggleGridView(bool)) + widget, &SketcherGeneralWidget::emitToggleGridView, + this , &TaskSketcherGeneral::onToggleGridView ); QObject::connect( - widget, SIGNAL(emitToggleGridSnap(bool)), - this , SLOT (onToggleGridSnap(bool)) + widget, &SketcherGeneralWidget::emitToggleGridSnap, + this , &TaskSketcherGeneral::onToggleGridSnap ); QObject::connect( - widget, SIGNAL(emitSetGridSize(double)), - this , SLOT (onSetGridSize(double)) + widget, &SketcherGeneralWidget::emitSetGridSize, + this , &TaskSketcherGeneral::onSetGridSize ); QObject::connect( - widget, SIGNAL(emitToggleAutoconstraints(bool)), - this , SLOT (onToggleAutoconstraints(bool)) + widget, &SketcherGeneralWidget::emitToggleAutoconstraints, + this , &TaskSketcherGeneral::onToggleAutoconstraints ); QObject::connect( - widget, SIGNAL(emitToggleAvoidRedundant(bool)), - this , SLOT (onToggleAvoidRedundant(bool)) + widget, &SketcherGeneralWidget::emitToggleAvoidRedundant, + this , &TaskSketcherGeneral::onToggleAvoidRedundant ); QObject::connect( - widget, SIGNAL(emitRenderOrderChanged()), - this , SLOT (onRenderOrderChanged()) + widget, &SketcherGeneralWidget::emitRenderOrderChanged, + this , &TaskSketcherGeneral::onRenderOrderChanged ); Gui::Selection().Attach(this);