Modernize signal/slot connection for real :)

This commit is contained in:
0penBrain
2022-02-07 21:08:45 +01:00
committed by wwmayer
parent 6030e9aac5
commit 73f2c1434a
4 changed files with 15 additions and 15 deletions

View File

@@ -1740,7 +1740,7 @@ ButtonGroup::ButtonGroup(QObject *parent)
{
QButtonGroup::setExclusive(false);
connect(this, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
connect(this, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked),
[=](QAbstractButton *button) {
if (exclusive()) {
for (auto btn : buttons()) {

View File

@@ -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<double>::of(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutXvalueChanged);
connect(ui->cutY, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutYvalueChanged);
connect(ui->cutZ, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutZvalueChanged);
connect(ui->cutX, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutXvalueChanged);
connect(ui->cutY, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &SectionCut::onCutYvalueChanged);
connect(ui->cutZ, qOverload<double>(&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);

View File

@@ -194,33 +194,33 @@ void TaskExtrudeParameters::connectSlots()
{
QMetaObject::connectSlotsByName(this);
connect(ui->lengthEdit, QOverload<double>::of(&Gui::PrefQuantitySpinBox::valueChanged),
connect(ui->lengthEdit, qOverload<double>(&Gui::PrefQuantitySpinBox::valueChanged),
this, &TaskExtrudeParameters::onLengthChanged);
connect(ui->lengthEdit2, QOverload<double>::of(&Gui::PrefQuantitySpinBox::valueChanged),
connect(ui->lengthEdit2, qOverload<double>(&Gui::PrefQuantitySpinBox::valueChanged),
this, &TaskExtrudeParameters::onLength2Changed);
connect(ui->offsetEdit, QOverload<double>::of(&Gui::PrefQuantitySpinBox::valueChanged),
connect(ui->offsetEdit, qOverload<double>(&Gui::PrefQuantitySpinBox::valueChanged),
this, &TaskExtrudeParameters::onOffsetChanged);
connect(ui->taperEdit, QOverload<double>::of(&Gui::PrefQuantitySpinBox::valueChanged),
connect(ui->taperEdit, qOverload<double>(&Gui::PrefQuantitySpinBox::valueChanged),
this, &TaskExtrudeParameters::onTaperChanged);
connect(ui->taperEdit2, QOverload<double>::of(&Gui::PrefQuantitySpinBox::valueChanged),
connect(ui->taperEdit2, qOverload<double>(&Gui::PrefQuantitySpinBox::valueChanged),
this, &TaskExtrudeParameters::onTaper2Changed);
connect(ui->directionCB, QOverload<int>::of(&QComboBox::activated),
connect(ui->directionCB, qOverload<int>(&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<double>::of(&QDoubleSpinBox::valueChanged),
connect(ui->XDirectionEdit, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &TaskExtrudeParameters::onXDirectionEditChanged);
connect(ui->YDirectionEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
connect(ui->YDirectionEdit, qOverload<double>(&QDoubleSpinBox::valueChanged),
this, &TaskExtrudeParameters::onYDirectionEditChanged);
connect(ui->ZDirectionEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
connect(ui->ZDirectionEdit, qOverload<double>(&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<int>::of(&QComboBox::currentIndexChanged),
connect(ui->changeMode, qOverload<int>(&QComboBox::currentIndexChanged),
this, &TaskExtrudeParameters::onModeChanged);
connect(ui->buttonFace, &QPushButton::clicked,
this, &TaskExtrudeParameters::onButtonFace);

View File

@@ -1075,7 +1075,7 @@ TaskDlgPipeParameters::TaskDlgPipeParameters(ViewProviderPipe *PipeView,bool new
buttonGroup->addButton(scaling->ui->buttonRefRemove,
StateHandlerTaskPipe::refSectionRemove);
connect(buttonGroup, QOverload<QAbstractButton *, bool>::of(&QButtonGroup::buttonToggled),
connect(buttonGroup, qOverload<QAbstractButton *, bool>(&QButtonGroup::buttonToggled),
this, &TaskDlgPipeParameters::onButtonToggled);
}