TD: move to new style connect()

This commit is contained in:
wmayer
2023-01-31 21:21:38 +01:00
committed by Uwe
parent 5c03db60e0
commit 25beef481c
31 changed files with 380 additions and 365 deletions

View File

@@ -87,28 +87,34 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawProjGroup* featView, bool mode) :
// Rotation buttons
// Note we don't do the custom one here, as it's handled by [a different function that's held up in customs]
connect(ui->butTopRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked()));
connect(ui->butCWRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked()));
connect(ui->butRightRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked()));
connect(ui->butDownRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked()));
connect(ui->butLeftRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked()));
connect(ui->butCCWRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked()));
connect(ui->butTopRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butCWRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butRightRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butDownRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butLeftRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butCCWRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
// //Reset button
// connect(ui->butReset, SIGNAL(clicked()), this, SLOT(onResetClicked()));
// Slot for Scale Type
connect(ui->cmbScaleType, SIGNAL(currentIndexChanged(int)), this, SLOT(scaleTypeChanged(int)));
connect(ui->sbScaleNum, SIGNAL(valueChanged(int)), this, SLOT(scaleManuallyChanged(int)));
connect(ui->sbScaleDen, SIGNAL(valueChanged(int)), this, SLOT(scaleManuallyChanged(int)));
connect(ui->cmbScaleType, qOverload<int>(&QComboBox::currentIndexChanged), this, &TaskProjGroup::scaleTypeChanged);
connect(ui->sbScaleNum, qOverload<int>(&QSpinBox::valueChanged), this, &TaskProjGroup::scaleManuallyChanged);
connect(ui->sbScaleDen, qOverload<int>(&QSpinBox::valueChanged), this, &TaskProjGroup::scaleManuallyChanged);
// Slot for Projection Type (layout)
connect(ui->projection, SIGNAL(currentIndexChanged(QString)), this, SLOT(projectionTypeChanged(QString)));
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
connect(ui->projection, qOverload<const QString&>(&QComboBox::currentIndexChanged), this, &TaskProjGroup::projectionTypeChanged);
#else
connect(ui->projection, qOverload<int>(&QComboBox::currentIndexChanged), this, [=](int index) {
projectionTypeChanged(ui->projection->itemText(index));
});
#endif
// Spacing
connect(ui->cbAutoDistribute, SIGNAL(clicked(bool)), this, SLOT(AutoDistributeClicked(bool)));
connect(ui->sbXSpacing, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged()));
connect(ui->sbYSpacing, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged()));
connect(ui->cbAutoDistribute, &QPushButton::clicked, this, &TaskProjGroup::AutoDistributeClicked);
connect(ui->sbXSpacing, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskProjGroup::spacingChanged);
connect(ui->sbYSpacing, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskProjGroup::spacingChanged);
ui->sbXSpacing->setUnit(Base::Unit::Length);
ui->sbYSpacing->setUnit(Base::Unit::Length);
@@ -457,7 +463,7 @@ void TaskProjGroup::setupViewCheckboxes(bool addConnections)
for (int i = 0; i < 10; ++i) {
QCheckBox *box = viewCheckboxes[i];
if (addConnections) {
connect(box, SIGNAL(toggled(bool)), this, SLOT(viewToggled(bool)));
connect(box, &QCheckBox::toggled, this, &TaskProjGroup::viewToggled);
}
const char *viewStr = viewChkIndexToCStr(i);