Mesh: move to new style connect()

This commit is contained in:
wmayer
2023-01-13 16:30:58 +01:00
parent 7d65afdf59
commit 880d05cf3c
7 changed files with 34 additions and 29 deletions

View File

@@ -79,8 +79,8 @@ void DlgDecimating::on_checkAbsolueNumber_toggled(bool on)
ui->groupBoxTolerance->setDisabled(on);
if (on) {
disconnect(ui->sliderReduction, SIGNAL(valueChanged(int)), ui->spinBoxReduction, SLOT(setValue(int)));
disconnect(ui->spinBoxReduction, SIGNAL(valueChanged(int)), ui->sliderReduction, SLOT(setValue(int)));
disconnect(ui->sliderReduction, qOverload<int>(&QSlider::valueChanged), ui->spinBoxReduction, &QSpinBox::setValue);
disconnect(ui->spinBoxReduction, qOverload<int>(&QSpinBox::valueChanged), ui->sliderReduction, &QSlider::setValue);
ui->spinBoxReduction->setRange(1, numberOfTriangles);
ui->spinBoxReduction->setValue(numberOfTriangles * (1.0 - reduction()));
ui->spinBoxReduction->setSuffix(QString());
@@ -91,8 +91,8 @@ void DlgDecimating::on_checkAbsolueNumber_toggled(bool on)
ui->spinBoxReduction->setValue(ui->sliderReduction->value());
ui->spinBoxReduction->setSuffix(QString::fromLatin1("%"));
ui->checkAbsolueNumber->setText(tr("Absolute number"));
connect(ui->sliderReduction, SIGNAL(valueChanged(int)), ui->spinBoxReduction, SLOT(setValue(int)));
connect(ui->spinBoxReduction, SIGNAL(valueChanged(int)), ui->sliderReduction, SLOT(setValue(int)));
connect(ui->sliderReduction, qOverload<int>(&QSlider::valueChanged), ui->spinBoxReduction, &QSpinBox::setValue);
connect(ui->spinBoxReduction, qOverload<int>(&QSpinBox::valueChanged), ui->sliderReduction, &QSlider::setValue);
}
}

View File

@@ -54,7 +54,7 @@ CleanupHandler::CleanupHandler()
: QObject(qApp)
{
// connect to lstWindowClosed signal
connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(cleanup()));
connect(qApp, &QApplication::lastWindowClosed, this, &CleanupHandler::cleanup);
}
// The lastWindowClosed signal will be emitted recursively and before the cleanup slot is finished
@@ -129,8 +129,8 @@ DlgEvaluateMeshImp::DlgEvaluateMeshImp(QWidget* parent, Qt::WindowFlags fl)
d->ui.line_8->setFrameShape(QFrame::HLine);
d->ui.line_8->setFrameShadow(QFrame::Sunken);
connect(d->ui.buttonBox, SIGNAL (helpRequested()),
Gui::getMainWindow(), SLOT (whatsThis()));
connect(d->ui.buttonBox, &QDialogButtonBox::helpRequested,
Gui::getMainWindow(), &Gui::MainWindow::whatsThis);
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Mesh/Evaluation");

View File

@@ -48,8 +48,13 @@ DlgSmoothing::DlgSmoothing(QWidget* parent)
bg = new QButtonGroup(this);
bg->addButton(ui->radioButtonTaubin, 0);
bg->addButton(ui->radioButtonLaplace, 1);
connect(bg, SIGNAL(buttonClicked(int)),
this, SLOT(method_clicked(int)));
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
connect(bg, qOverload<int>(&QButtonGroup::buttonClicked),
this, &DlgSmoothing::method_clicked);
#else
connect(bg, &QButtonGroup::idClicked,
this, &DlgSmoothing::method_clicked);
#endif
ui->labelLambda->setText(QString::fromUtf8("\xce\xbb"));
ui->labelMu->setText(QString::fromUtf8("\xce\xbc"));
@@ -123,10 +128,10 @@ SmoothingDialog::SmoothingDialog(QWidget* parent, Qt::WindowFlags fl)
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
connect(buttonBox, SIGNAL(accepted()),
this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted,
this, &SmoothingDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected,
this, &SmoothingDialog::reject);
hboxLayout->addWidget(widget);
hboxLayout->addWidget(buttonBox);
@@ -156,8 +161,8 @@ TaskSmoothing::TaskSmoothing()
tasksel->hide();
Content.push_back(tasksel);
connect(widget, SIGNAL(toggledSelection(bool)),
tasksel, SLOT(setVisible(bool)));
connect(widget, &DlgSmoothing::toggledSelection,
tasksel, &Gui::TaskView::TaskBox::setVisible);
}
TaskSmoothing::~TaskSmoothing()

View File

@@ -73,15 +73,15 @@ GmshWidget::GmshWidget(QWidget* parent, Qt::WindowFlags fl)
: QWidget(parent, fl)
, d(new Private(parent))
{
connect(&d->gmsh, SIGNAL(started()), this, SLOT(started()));
connect(&d->gmsh, SIGNAL(finished(int, QProcess::ExitStatus)),
this, SLOT(finished(int, QProcess::ExitStatus)));
connect(&d->gmsh, SIGNAL(errorOccurred(QProcess::ProcessError)),
this, SLOT(errorOccurred(QProcess::ProcessError)));
connect(&d->gmsh, SIGNAL(readyReadStandardError()),
this, SLOT(readyReadStandardError()));
connect(&d->gmsh, SIGNAL(readyReadStandardOutput()),
this, SLOT(readyReadStandardOutput()));
connect(&d->gmsh, &QProcess::started, this, &GmshWidget::started);
connect(&d->gmsh, qOverload<int, QProcess::ExitStatus>(&QProcess::finished),
this, &GmshWidget::finished);
connect(&d->gmsh, &QProcess::errorOccurred,
this, &GmshWidget::errorOccurred);
connect(&d->gmsh, &QProcess::readyReadStandardError,
this, &GmshWidget::readyReadStandardError);
connect(&d->gmsh, &QProcess::readyReadStandardOutput,
this, &GmshWidget::readyReadStandardOutput);
d->ui.setupUi(this);
d->ui.fileChooser->onRestore();

View File

@@ -175,8 +175,8 @@ RemoveComponentsDialog::RemoveComponentsDialog(QWidget* parent, Qt::WindowFlags
buttonBox->addButton(MeshGui::TaskRemoveComponents::tr("Invert"),
QDialogButtonBox::ActionRole);
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)),
this, SLOT(clicked(QAbstractButton*)));
connect(buttonBox, &QDialogButtonBox::clicked,
this, &RemoveComponentsDialog::clicked);
hboxLayout->addWidget(widget);
hboxLayout->addWidget(buttonBox);

View File

@@ -221,8 +221,8 @@ ParametersDialog::ParametersDialog(std::vector<float>& val, FitParameter* fitPar
++index;
}
QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QObject::connect(buttonBox, &QDialogButtonBox::accepted, this, &ParametersDialog::accept);
QObject::connect(buttonBox, &QDialogButtonBox::rejected, this, &ParametersDialog::reject);
QMetaObject::connectSlotsByName(this);
Gui::SelectionObject obj(mesh);

View File

@@ -56,7 +56,7 @@ Tessellation::Tessellation(QWidget* parent)
{
ui->setupUi(this);
gmsh = new Mesh2ShapeGmsh(this);
connect(gmsh, SIGNAL(processed()), this, SLOT(gmshProcessed()));
connect(gmsh, &Mesh2ShapeGmsh::processed, this, &Tessellation::gmshProcessed);
ui->stackedWidget->addTab(gmsh, tr("Gmsh"));