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

@@ -56,7 +56,7 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di
// Tolerancing
ui->cbTheoreticallyExact->setChecked(parent->getDimFeat()->TheoreticalExact.getValue());
connect(ui->cbTheoreticallyExact, SIGNAL(stateChanged(int)), this, SLOT(onTheoreticallyExactChanged()));
connect(ui->cbTheoreticallyExact, &QCheckBox::stateChanged, this, &TaskDimension::onTheoreticallyExactChanged);
// if TheoreticalExact disable tolerances
if (parent->getDimFeat()->TheoreticalExact.getValue()) {
ui->cbEqualTolerance->setDisabled(true);
@@ -66,7 +66,7 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di
ui->leFormatSpecifierUnderTolerance->setDisabled(true);
}
ui->cbEqualTolerance->setChecked(parent->getDimFeat()->EqualTolerance.getValue());
connect(ui->cbEqualTolerance, SIGNAL(stateChanged(int)), this, SLOT(onEqualToleranceChanged()));
connect(ui->cbEqualTolerance, &QCheckBox::stateChanged, this, &TaskDimension::onEqualToleranceChanged);
// if EqualTolerance overtolernace must not be negative
if (parent->getDimFeat()->EqualTolerance.getValue())
ui->qsbOvertolerance->setMinimum(0.0);
@@ -81,8 +81,8 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di
}
ui->qsbOvertolerance->setValue(parent->getDimFeat()->OverTolerance.getValue());
ui->qsbUndertolerance->setValue(parent->getDimFeat()->UnderTolerance.getValue());
connect(ui->qsbOvertolerance, SIGNAL(valueChanged(double)), this, SLOT(onOvertoleranceChanged()));
connect(ui->qsbUndertolerance, SIGNAL(valueChanged(double)), this, SLOT(onUndertoleranceChanged()));
connect(ui->qsbOvertolerance, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskDimension::onOvertoleranceChanged);
connect(ui->qsbUndertolerance, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskDimension::onUndertoleranceChanged);
// undertolerance is disabled when EqualTolerance is true
if (ui->cbEqualTolerance->isChecked()) {
ui->qsbUndertolerance->setDisabled(true);
@@ -93,45 +93,45 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di
std::string StringValue = parent->getDimFeat()->FormatSpec.getValue();
QString qs = QString::fromUtf8(StringValue.data(), StringValue.size());
ui->leFormatSpecifier->setText(qs);
connect(ui->leFormatSpecifier, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierChanged()));
connect(ui->leFormatSpecifier, &QLineEdit::textChanged, this, &TaskDimension::onFormatSpecifierChanged);
ui->cbArbitrary->setChecked(parent->getDimFeat()->Arbitrary.getValue());
connect(ui->cbArbitrary, SIGNAL(stateChanged(int)), this, SLOT(onArbitraryChanged()));
connect(ui->cbArbitrary, &QCheckBox::stateChanged, this, &TaskDimension::onArbitraryChanged);
StringValue = parent->getDimFeat()->FormatSpecOverTolerance.getValue();
qs = QString::fromUtf8(StringValue.data(), StringValue.size());
ui->leFormatSpecifierOverTolerance->setText(qs);
StringValue = parent->getDimFeat()->FormatSpecUnderTolerance.getValue();
qs = QString::fromUtf8(StringValue.data(), StringValue.size());
ui->leFormatSpecifierUnderTolerance->setText(qs);
connect(ui->leFormatSpecifierOverTolerance, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierOverToleranceChanged()));
connect(ui->leFormatSpecifierUnderTolerance, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierUnderToleranceChanged()));
connect(ui->leFormatSpecifierOverTolerance, &QLineEdit::textChanged, this, &TaskDimension::onFormatSpecifierOverToleranceChanged);
connect(ui->leFormatSpecifierUnderTolerance, &QLineEdit::textChanged, this, &TaskDimension::onFormatSpecifierUnderToleranceChanged);
ui->cbArbitraryTolerances->setChecked(parent->getDimFeat()->ArbitraryTolerances.getValue());
connect(ui->cbArbitraryTolerances, SIGNAL(stateChanged(int)), this, SLOT(onArbitraryTolerancesChanged()));
connect(ui->cbArbitraryTolerances, &QCheckBox::stateChanged, this, &TaskDimension::onArbitraryTolerancesChanged);
// Display Style
if (dimensionVP) {
ui->cbArrowheads->setChecked(dimensionVP->FlipArrowheads.getValue());
connect(ui->cbArrowheads, SIGNAL(stateChanged(int)), this, SLOT(onFlipArrowheadsChanged()));
connect(ui->cbArrowheads, &QCheckBox::stateChanged, this, &TaskDimension::onFlipArrowheadsChanged);
ui->dimensionColor->setColor(dimensionVP->Color.getValue().asValue<QColor>());
connect(ui->dimensionColor, SIGNAL(changed()), this, SLOT(onColorChanged()));
connect(ui->dimensionColor, &ColorButton::changed, this, &TaskDimension::onColorChanged);
ui->qsbFontSize->setValue(dimensionVP->Fontsize.getValue());
ui->qsbFontSize->setUnit(Base::Unit::Length);
ui->qsbFontSize->setMinimum(0);
connect(ui->qsbFontSize, SIGNAL(valueChanged(double)), this, SLOT(onFontsizeChanged()));
connect(ui->qsbFontSize, qOverload<double>(&QuantitySpinBox::valueChanged), this, &TaskDimension::onFontsizeChanged);
ui->comboDrawingStyle->setCurrentIndex(dimensionVP->StandardAndStyle.getValue());
connect(ui->comboDrawingStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(onDrawingStyleChanged()));
connect(ui->comboDrawingStyle, qOverload<int>(&QComboBox::currentIndexChanged), this, &TaskDimension::onDrawingStyleChanged);
}
// Lines
ui->rbOverride->setChecked(parent->getDimFeat()->AngleOverride.getValue());
connect(ui->rbOverride, SIGNAL(toggled(bool)), this, SLOT(onOverrideToggled()));
connect(ui->rbOverride, &QRadioButton::toggled, this, &TaskDimension::onOverrideToggled);
ui->dsbDimAngle->setValue(parent->getDimFeat()->LineAngle.getValue());
connect(ui->dsbDimAngle, SIGNAL(valueChanged(double)), this, SLOT(onDimAngleChanged()));
connect(ui->dsbDimAngle, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &TaskDimension::onDimAngleChanged);
ui->dsbExtAngle->setValue(parent->getDimFeat()->ExtensionAngle.getValue());
connect(ui->dsbExtAngle, SIGNAL(valueChanged(double)), this, SLOT(onExtAngleChanged()));
connect(ui->pbDimUseDefault, SIGNAL(clicked()), this, SLOT(onDimUseDefaultClicked()));
connect(ui->pbDimUseSelection, SIGNAL(clicked()), this, SLOT(onDimUseSelectionClicked()));
connect(ui->pbExtUseDefault, SIGNAL(clicked()), this, SLOT(onExtUseDefaultClicked()));
connect(ui->pbExtUseSelection, SIGNAL(clicked()), this, SLOT(onExtUseSelectionClicked()));
connect(ui->dsbExtAngle, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &TaskDimension::onExtAngleChanged);
connect(ui->pbDimUseDefault, &QPushButton::clicked, this, &TaskDimension::onDimUseDefaultClicked);
connect(ui->pbDimUseSelection, &QPushButton::clicked, this, &TaskDimension::onDimUseSelectionClicked);
connect(ui->pbExtUseDefault, &QPushButton::clicked, this, &TaskDimension::onExtUseDefaultClicked);
connect(ui->pbExtUseSelection, &QPushButton::clicked, this, &TaskDimension::onExtUseSelectionClicked);
Gui::Document* doc = m_dimensionVP->getDocument();
doc->openCommand("TaskDimension");