From 73f2c1434a3ef8fe82515681dbe5be31fa48bb7b Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:08:45 +0100 Subject: [PATCH] Modernize signal/slot connection for real :) --- src/Gui/Widgets.cpp | 2 +- src/Mod/Part/Gui/SectionCutting.cpp | 6 +++--- .../PartDesign/Gui/TaskExtrudeParameters.cpp | 20 +++++++++---------- src/Mod/PartDesign/Gui/TaskPipeParameters.cpp | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index d34abcae38..322cc8a8ec 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -1740,7 +1740,7 @@ ButtonGroup::ButtonGroup(QObject *parent) { QButtonGroup::setExclusive(false); - connect(this, QOverload::of(&QButtonGroup::buttonClicked), + connect(this, qOverload(&QButtonGroup::buttonClicked), [=](QAbstractButton *button) { if (exclusive()) { for (auto btn : buttons()) { diff --git a/src/Mod/Part/Gui/SectionCutting.cpp b/src/Mod/Part/Gui/SectionCutting.cpp index 4e6a292ad9..0f140f413d 100644 --- a/src/Mod/Part/Gui/SectionCutting.cpp +++ b/src/Mod/Part/Gui/SectionCutting.cpp @@ -161,9 +161,9 @@ SectionCut::SectionCut(QWidget* parent) connect(ui->groupBoxX, &QGroupBox::toggled, this, &SectionCut::onGroupBoxXtoggled); connect(ui->groupBoxY, &QGroupBox::toggled, this, &SectionCut::onGroupBoxYtoggled); connect(ui->groupBoxZ, &QGroupBox::toggled, this, &SectionCut::onGroupBoxZtoggled); - connect(ui->cutX, QOverload::of(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutXvalueChanged); - connect(ui->cutY, QOverload::of(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutYvalueChanged); - connect(ui->cutZ, QOverload::of(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutZvalueChanged); + connect(ui->cutX, qOverload(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutXvalueChanged); + connect(ui->cutY, qOverload(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutYvalueChanged); + connect(ui->cutZ, qOverload(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutZvalueChanged); connect(ui->cutXHS, &QSlider::sliderMoved, this, &SectionCut::onCutXHSsliderMoved); connect(ui->cutYHS, &QSlider::sliderMoved, this, &SectionCut::onCutYHSsliderMoved); connect(ui->cutZHS, &QSlider::sliderMoved, this, &SectionCut::onCutZHSsliderMoved); diff --git a/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp b/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp index 4c8d91c850..e4d0c09c4d 100644 --- a/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskExtrudeParameters.cpp @@ -194,33 +194,33 @@ void TaskExtrudeParameters::connectSlots() { QMetaObject::connectSlotsByName(this); - connect(ui->lengthEdit, QOverload::of(&Gui::PrefQuantitySpinBox::valueChanged), + connect(ui->lengthEdit, qOverload(&Gui::PrefQuantitySpinBox::valueChanged), this, &TaskExtrudeParameters::onLengthChanged); - connect(ui->lengthEdit2, QOverload::of(&Gui::PrefQuantitySpinBox::valueChanged), + connect(ui->lengthEdit2, qOverload(&Gui::PrefQuantitySpinBox::valueChanged), this, &TaskExtrudeParameters::onLength2Changed); - connect(ui->offsetEdit, QOverload::of(&Gui::PrefQuantitySpinBox::valueChanged), + connect(ui->offsetEdit, qOverload(&Gui::PrefQuantitySpinBox::valueChanged), this, &TaskExtrudeParameters::onOffsetChanged); - connect(ui->taperEdit, QOverload::of(&Gui::PrefQuantitySpinBox::valueChanged), + connect(ui->taperEdit, qOverload(&Gui::PrefQuantitySpinBox::valueChanged), this, &TaskExtrudeParameters::onTaperChanged); - connect(ui->taperEdit2, QOverload::of(&Gui::PrefQuantitySpinBox::valueChanged), + connect(ui->taperEdit2, qOverload(&Gui::PrefQuantitySpinBox::valueChanged), this, &TaskExtrudeParameters::onTaper2Changed); - connect(ui->directionCB, QOverload::of(&QComboBox::activated), + connect(ui->directionCB, qOverload(&QComboBox::activated), this, &TaskExtrudeParameters::onDirectionCBChanged); connect(ui->checkBoxAlongDirection, &QCheckBox::toggled, this, &TaskExtrudeParameters::onAlongSketchNormalChanged); connect(ui->checkBoxDirection, &QCheckBox::toggled, this, &TaskExtrudeParameters::onDirectionToggled); - connect(ui->XDirectionEdit, QOverload::of(&QDoubleSpinBox::valueChanged), + connect(ui->XDirectionEdit, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskExtrudeParameters::onXDirectionEditChanged); - connect(ui->YDirectionEdit, QOverload::of(&QDoubleSpinBox::valueChanged), + connect(ui->YDirectionEdit, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskExtrudeParameters::onYDirectionEditChanged); - connect(ui->ZDirectionEdit, QOverload::of(&QDoubleSpinBox::valueChanged), + connect(ui->ZDirectionEdit, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskExtrudeParameters::onZDirectionEditChanged); connect(ui->checkBoxMidplane, &QCheckBox::toggled, this, &TaskExtrudeParameters::onMidplaneChanged); connect(ui->checkBoxReversed, &QCheckBox::toggled, this, &TaskExtrudeParameters::onReversedChanged); - connect(ui->changeMode, QOverload::of(&QComboBox::currentIndexChanged), + connect(ui->changeMode, qOverload(&QComboBox::currentIndexChanged), this, &TaskExtrudeParameters::onModeChanged); connect(ui->buttonFace, &QPushButton::clicked, this, &TaskExtrudeParameters::onButtonFace); diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp index c667ad6c4f..40a1a2ca10 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp @@ -1075,7 +1075,7 @@ TaskDlgPipeParameters::TaskDlgPipeParameters(ViewProviderPipe *PipeView,bool new buttonGroup->addButton(scaling->ui->buttonRefRemove, StateHandlerTaskPipe::refSectionRemove); - connect(buttonGroup, QOverload::of(&QButtonGroup::buttonToggled), + connect(buttonGroup, qOverload(&QButtonGroup::buttonToggled), this, &TaskDlgPipeParameters::onButtonToggled); }