From e82c3ac864ab228f2db7a399d9a32a6ccbe80e32 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Fri, 15 Aug 2025 10:05:33 +0200 Subject: [PATCH 1/7] clazy fixit old-style-connect --- astigscatterplot.cpp | 2 +- astigstatsdlg.cpp | 10 ++-- batchigramwizard.cpp | 20 ++++---- camwizardpage1.cpp | 2 +- contourtools.cpp | 2 +- contourview.cpp | 6 +-- dftarea.cpp | 20 ++++---- foucaultview.cpp | 10 ++-- igramarea.cpp | 26 +++++------ intensityplot.cpp | 2 +- jitteroutlinedlg.cpp | 4 +- mainwindow.cpp | 98 ++++++++++++++++++++-------------------- mirrordlg.cpp | 2 +- nullvariationdlg.cpp | 2 +- oglview.cpp | 16 +++---- outlinedialog.cpp | 12 ++--- pixelstats.cpp | 2 +- profileplot.cpp | 28 ++++++------ settingsgeneral2.cpp | 2 +- settingsigram.cpp | 6 +-- simulationsview.cpp | 6 +-- standastigwizard.cpp | 14 +++--- surfaceanalysistools.cpp | 10 ++-- surfacemanager.cpp | 48 ++++++++++---------- wavefrontfilterdlg.cpp | 4 +- wavefrontloader.cpp | 8 ++-- zernikesmoothingdlg.cpp | 2 +- 27 files changed, 182 insertions(+), 182 deletions(-) diff --git a/astigscatterplot.cpp b/astigscatterplot.cpp index 2e2a8ab8..f1198f8f 100644 --- a/astigscatterplot.cpp +++ b/astigscatterplot.cpp @@ -12,7 +12,7 @@ astigScatterPlot::astigScatterPlot(QWidget *parent):QwtPlot( parent ),m_max(.3) { Picker = new myPlotPicker( this ); - connect(Picker, SIGNAL(mySelected(QString)),this,SLOT(selectedwave(QString))); + connect(Picker, &myPlotPicker::mySelected,this,&astigScatterPlot::selectedwave); QwtPlotGrid *grid = new QwtPlotGrid(); grid->setPen( Qt::gray, 0.0, Qt::DotLine ); diff --git a/astigstatsdlg.cpp b/astigstatsdlg.cpp index 6ba75c09..300f7488 100644 --- a/astigstatsdlg.cpp +++ b/astigstatsdlg.cpp @@ -261,7 +261,7 @@ void astigStatsDlg::plot(){ QwtLegend *l = new QwtLegend(); ui->mPlot->insertLegend( l, QwtPlot::TopLegend ); l->setDefaultItemMode( QwtLegendData::Checkable ); - connect(l, SIGNAL(checked(QVariant,bool,int)), this, SLOT(showItem(QVariant ,bool,int))); + connect(l, &QwtLegend::checked, this, &astigStatsDlg::showItem); if(picker != nullptr){ delete picker; @@ -734,17 +734,17 @@ void astigStatsDlg::on_distribution_clicked() distributionWindow->setLayout(layout); // build the toolBar QPushButton *pbMakePDF = new QPushButton("Save as PDF"); - connect(pbMakePDF, SIGNAL(pressed()), this, SLOT(on_savePdf())); + connect(pbMakePDF, &QAbstractButton::pressed, this, &astigStatsDlg::on_savePdf); QCheckBox *showSamplesCB = new QCheckBox("Show individual samples"); showSamplesCB->setChecked(showSamples); - connect(showSamplesCB, SIGNAL(clicked(bool)), this, SLOT(showSamplesChanged(bool))); + connect(showSamplesCB, &QAbstractButton::clicked, this, &astigStatsDlg::showSamplesChanged); QSpinBox *runningAvgNSB = new QSpinBox; runningAvgNSB->setValue(runningAvgN); runningAvgNSB->setMaximum(1000); runningAvgNSB->setSingleStep(10); - connect(runningAvgNSB, SIGNAL(valueChanged(int)), this, SLOT(runningNChanged(int))); + connect(runningAvgNSB, &QSpinBox::valueChanged, this, &astigStatsDlg::runningNChanged); QCheckBox *polarCB = new QCheckBox("Polar"); - connect(polarCB, SIGNAL(clicked(bool)), this, SLOT(usePolar(bool))); + connect(polarCB, &QAbstractButton::clicked, this, &astigStatsDlg::usePolar); toolLayout->addWidget(showSamplesCB); diff --git a/batchigramwizard.cpp b/batchigramwizard.cpp index 50268b49..69dea17a 100644 --- a/batchigramwizard.cpp +++ b/batchigramwizard.cpp @@ -95,7 +95,7 @@ void batchIntro::showContextMenu(QPoint pos) // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("Erase", this, SLOT(eraseItem())); + myMenu.addAction("Erase", this, &batchIntro::eraseItem); // Show context menu at handling position myMenu.exec(globalPos); @@ -136,21 +136,21 @@ batchIntro::batchIntro(QStringList files, QWidget *manager, QWidget *p): filesList->addItem(itm); } filesList->setContextMenuPolicy(Qt::CustomContextMenu); - connect(filesList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); + connect(filesList, &QWidget::customContextMenuRequested, this, &batchIntro::showContextMenu); - connect(this, SIGNAL(processBatchList(QStringList)), qobject_cast(manager), SLOT(batchProcess(QStringList))); + connect(this, &batchIntro::processBatchList, qobject_cast(manager), &MainWindow::batchProcess); QSettings set; pgrBar = new QProgressBar; batchIgramWizard::addFiles = new QPushButton(tr("Add Files")); batchIgramWizard::skipFile = new QPushButton(tr("Skip")); - connect(batchIgramWizard::skipFile, SIGNAL(clicked(bool)), qobject_cast(manager), SLOT(skipBatchItem())); + connect(batchIgramWizard::skipFile, &QAbstractButton::clicked, qobject_cast(manager), &MainWindow::skipBatchItem); batchIgramWizard::skipFile->setEnabled(false); - connect(batchIgramWizard::addFiles, SIGNAL(pressed()), this, SLOT(addFiles())); + connect(batchIgramWizard::addFiles, &QAbstractButton::pressed, this, &batchIntro::addFiles); batchIgramWizard::autoCb = new QCheckBox(tr("Auto"),this); batchIgramWizard::filterCb = new QCheckBox(tr("Filter"),this); batchIgramWizard::filterCb->setChecked( set.value("batchWizardFilterFlag", false).toBool()); - connect(batchIgramWizard::filterCb, SIGNAL(clicked(bool)), this, SLOT(on_filter(bool))); + connect(batchIgramWizard::filterCb, &QAbstractButton::clicked, this, &batchIntro::on_filter); batchIgramWizard::saveFile = new QCheckBox(tr("Save wavefront file"),this); batchIgramWizard::saveFile->setChecked(set.value("batchSaveFile", false).toBool()); batchIgramWizard::deletePreviousWave = new QCheckBox(tr("Delete Prev Wave"), this); @@ -159,13 +159,13 @@ batchIntro::batchIntro(QStringList files, QWidget *manager, QWidget *p): batchIgramWizard::deletePreviousWave->setChecked(set.value("deletePrevWave", false).toBool()); batchIgramWizard::showProcessPlots = new QCheckBox(tr("Show Process Plots")); batchIgramWizard::showProcessPlots->setChecked(true); - connect(batchIgramWizard::showProcessPlots, SIGNAL(clicked(bool)),this, SLOT(showPlots(bool))); - connect(batchIgramWizard::saveFile, SIGNAL(clicked(bool)),this, SLOT(on_saveFiles(bool))); - connect(batchIgramWizard::deletePreviousWave, SIGNAL(clicked(bool)),this, SLOT(on_deletePreviousWave(bool))); + connect(batchIgramWizard::showProcessPlots, &QAbstractButton::clicked,this, &batchIntro::showPlots); + connect(batchIgramWizard::saveFile, &QAbstractButton::clicked,this, &batchIntro::on_saveFiles); + connect(batchIgramWizard::deletePreviousWave, &QAbstractButton::clicked,this, &batchIntro::on_deletePreviousWave); QHBoxLayout *hlayout = new QHBoxLayout(); QGroupBox *outlineGB = new QGroupBox("Auto Outlines"); batchIgramWizard::goPb = new QPushButton(tr("Process Igrams"),this); - connect(batchIgramWizard::goPb, SIGNAL(pressed()), this, SLOT(processBatch())); + connect(batchIgramWizard::goPb, &QAbstractButton::pressed, this, &batchIntro::processBatch); batchIgramWizard::goPb->setStyleSheet("QPushButton{" " background-color: red;" "border-style: outset;" diff --git a/camwizardpage1.cpp b/camwizardpage1.cpp index 8a1b8920..5bc528b9 100644 --- a/camwizardpage1.cpp +++ b/camwizardpage1.cpp @@ -31,7 +31,7 @@ CamWizardPage1::CamWizardPage1(QWidget *parent) : { ui->setupUi(this); ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(ui->listWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); + connect(ui->listWidget, &QWidget::customContextMenuRequested, this, &CamWizardPage1::showContextMenu); QSettings set; Pattern p = (Pattern)(set.value("camCalibratePattern", CIRCLES_GRID).toInt()); ui->columns->blockSignals(true); diff --git a/contourtools.cpp b/contourtools.cpp index 22b83417..802c2424 100644 --- a/contourtools.cpp +++ b/contourtools.cpp @@ -55,7 +55,7 @@ ContourTools::ContourTools(QWidget *parent) : ui->lineColorDisplay->setPalette(pal); ui->lineColorDisplay->setAutoFillBackground( true ); m_minmaxEditTimer = new QTimer(this); - connect(m_minmaxEditTimer, SIGNAL(timeout()),this, SLOT(updateMinMax())); + connect(m_minmaxEditTimer, &QTimer::timeout,this, &ContourTools::updateMinMax); } diff --git a/contourview.cpp b/contourview.cpp index ed52bd3c..ee302c42 100644 --- a/contourview.cpp +++ b/contourview.cpp @@ -34,8 +34,8 @@ contourView::contourView(QWidget *parent, ContourTools *tools) : ui->fillContourCB->setChecked(set.value("contourShowFill", true).toBool()); ui->showRuler->setChecked(set.value("contourShowRuler",false).toBool()); setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(showContextMenu(QPoint))); + connect(this, &QWidget::customContextMenuRequested, this, + &contourView::showContextMenu); setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); ps = new pixelStats; @@ -76,7 +76,7 @@ void contourView::showContextMenu(QPoint pos) // Create menu and insert some actions QMenu myMenu; QString txt = (zoomed)? tr("Restore to MainWindow") : tr("FullScreen"); - myMenu.addAction(txt, this, SLOT(zoom())); + myMenu.addAction(txt, this, &contourView::zoom); // Show context menu at handling position myMenu.exec(globalPos); diff --git a/dftarea.cpp b/dftarea.cpp index 232db75c..b1f70d18 100644 --- a/dftarea.cpp +++ b/dftarea.cpp @@ -117,23 +117,23 @@ DFTArea::DFTArea(QWidget *mparent, IgramArea *ip, DFTTools * tools, vortexDebug m_Psidlg->setGeometry(rec); - connect(m_Psidlg, SIGNAL(computePhase()),this, SLOT(computePhases())); + connect(m_Psidlg, &PSI_dlg::computePhase,this, &DFTArea::computePhases); ui->setupUi(this); m_gamma = 2.5; - connect(tools,SIGNAL(dftChannel(const QString&)), this, SLOT(setChannel(const QString&))); - connect(tools,SIGNAL(dftSizeVal(int)), this, SLOT(dftSizeVal(int))); - connect(tools,SIGNAL(dftCenterFilter(double)), this, SLOT(dftCenterFilter(double))); - connect(tools,SIGNAL(makeSurface()), this,SLOT(makeSurface())); - connect(tools,SIGNAL(doDFT()), this,SLOT(doDFT())); - connect(tools,SIGNAL(showResized()),this, SLOT(showResizedDlg())); + connect(tools,&DFTTools::dftChannel, this, &DFTArea::setChannel); + connect(tools,&DFTTools::dftSizeVal, this, &DFTArea::dftSizeVal); + connect(tools,&DFTTools::dftCenterFilter, this, &DFTArea::dftCenterFilter); + connect(tools,&DFTTools::makeSurface, this,&DFTArea::makeSurface); + connect(tools,&DFTTools::doDFT, this,&DFTArea::doDFT); + connect(tools,&DFTTools::showResized,this, &DFTArea::showResizedDlg); QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_Plus), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomPlus())); + QObject::connect(shortcut, &QShortcut::activated, this, &DFTArea::zoomPlus); shortcut = new QShortcut(QKeySequence(Qt::Key_Minus), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomMinus())); + QObject::connect(shortcut, &QShortcut::activated, this, &DFTArea::zoomMinus); shortcut = new QShortcut(QKeySequence(Qt::Key_F), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomFit())); + QObject::connect(shortcut, &QShortcut::activated, this, &DFTArea::zoomFit); tools->connectTo(this); capture = false; diff --git a/foucaultview.cpp b/foucaultview.cpp index 5aa9b57a..70b6ab43 100644 --- a/foucaultview.cpp +++ b/foucaultview.cpp @@ -21,7 +21,7 @@ foucaultView::foucaultView(QWidget *parent, SurfaceManager *sm) : ui->setupUi(this); QSettings set; ui->lpiSb->setValue(set.value("ronchiLPI", 100).toDouble()); - connect(&m_guiTimer, SIGNAL(timeout()), this, SLOT(on_makePb_clicked())); + connect(&m_guiTimer, &QTimer::timeout, this, &foucaultView::on_makePb_clicked); ui->rocOffsetSb->setSuffix(" inch"); ui->useMM->setChecked(set.value("simUseMM",false).toBool()); ui->RonchiX->blockSignals(true); @@ -30,8 +30,8 @@ foucaultView::foucaultView(QWidget *parent, SurfaceManager *sm) : if (ui->useMM->isChecked()){ on_useMM_clicked(true); } - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(showContextMenu(QPoint))); + connect(this, &QWidget::customContextMenuRequested, this, + &foucaultView::showContextMenu); setContextMenuPolicy(Qt::CustomContextMenu); } @@ -72,8 +72,8 @@ void foucaultView::showContextMenu(QPoint pos) QPoint globalPos = mapToGlobal(pos); // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("Save Ronchi image", this, SLOT(saveRonchiImage())); - myMenu.addAction("Save Foucault Image", this, SLOT(saveFoucaultImage())); + myMenu.addAction("Save Ronchi image", this, &foucaultView::saveRonchiImage); + myMenu.addAction("Save Foucault Image", this, &foucaultView::saveFoucaultImage); // Show context menu at handling position myMenu.exec(globalPos); diff --git a/igramarea.cpp b/igramarea.cpp index 86c37727..1ee60f6f 100644 --- a/igramarea.cpp +++ b/igramarea.cpp @@ -112,37 +112,37 @@ IgramArea::IgramArea(QWidget *parent, void *mw) m_dftThumb = new dftThumb(this); m_dftThumb->setWindowFlags( Qt::WindowStaysOnTopHint); m_outlineTimer = new QTimer(this); - connect(m_outlineTimer, SIGNAL(timeout()),this, SLOT(outlineTimerTimeout())); + connect(m_outlineTimer, &QTimer::timeout,this, &IgramArea::outlineTimerTimeout); m_doGamma = false; m_gammaValue = 2.2; m_lastGamma = 2.2; needToConvertBGR = false; QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_Down), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftDown())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::shiftDown); shortcut = new QShortcut(QKeySequence(Qt::Key_Up), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftUp())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::shiftUp); shortcut = new QShortcut(QKeySequence(Qt::Key_Left), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftLeft())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::shiftLeft); shortcut = new QShortcut(QKeySequence(Qt::Key_Right), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftRight())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::shiftRight); shortcut = new QShortcut(QKeySequence(Qt::Key_Minus), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(decrease())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::decrease); shortcut = new QShortcut(QKeySequence(Qt::Key_Plus), this); QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(increase())); shortcut = new QShortcut(QKeySequence("f"), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomFull())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::zoomFull); shortcut = new QShortcut(QKeySequence("h"), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(toggleHideOutline())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::toggleHideOutline); shortcut = new QShortcut(QKeySequence::ZoomIn, this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomIn())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::zoomIn); shortcut = new QShortcut(QKeySequence::ZoomOut, this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(zoomOut())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::zoomOut); shortcut = new QShortcut(QKeySequence("1"), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(edgeMode())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::edgeMode); - connect(colorChannel::get_instance(),SIGNAL(useChannelsChanged()), this, SLOT(colorChannelChanged())); + connect(colorChannel::get_instance(),&colorChannel::useChannelsChanged, this, &IgramArea::colorChannelChanged); - connect(mirrorDlg::get_Instance(), SIGNAL(aperatureChanged()), this, SLOT(aperatureChanged())); + connect(mirrorDlg::get_Instance(), &mirrorDlg::aperatureChanged, this, &IgramArea::aperatureChanged); m_edgeMaskWidth = 0; } void IgramArea::computeEdgeRadius(){ diff --git a/intensityplot.cpp b/intensityplot.cpp index e2d51f96..cda11da8 100644 --- a/intensityplot.cpp +++ b/intensityplot.cpp @@ -145,7 +145,7 @@ intensityPlot::intensityPlot(QWidget *parent): new QwtCompassMagnetNeedle( QwtCompassMagnetNeedle::ThinStyle ) ); compass->setValue( 0 ); compass->setOrigin( -90 ); - connect(compass,SIGNAL(valueChanged(double)),this ,SLOT(angleChanged(double))); + connect(compass,&QwtAbstractSlider::valueChanged,this ,&intensityPlot::angleChanged); populate(); resize(QGuiApplication::primaryScreen()->availableSize() * 1./ 5.); diff --git a/jitteroutlinedlg.cpp b/jitteroutlinedlg.cpp index e707a14d..0ed11cfe 100644 --- a/jitteroutlinedlg.cpp +++ b/jitteroutlinedlg.cpp @@ -13,8 +13,8 @@ jitterOutlineDlg::jitterOutlineDlg(QWidget *parent) : jitterOutlineDlg *jitterOutlineDlg::getInstance(MainWindow *mw){ if (m_instance ==0){ m_instance= new jitterOutlineDlg; - connect(m_instance->ui->startPb, SIGNAL(clicked(bool)), mw,SLOT(startJitter())); - connect(m_instance->ui->StopPb, SIGNAL(clicked(bool)),mw,SLOT(stopJitter())); + connect(m_instance->ui->startPb, &QAbstractButton::clicked, mw,&MainWindow::startJitter); + connect(m_instance->ui->StopPb, &QAbstractButton::clicked,mw,&MainWindow::stopJitter); } return m_instance; diff --git a/mainwindow.cpp b/mainwindow.cpp index 9ad4bb0e..e06cd810 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -106,12 +106,12 @@ MainWindow::MainWindow(QWidget *parent) : gscrollArea = scrollArea; m_igramArea = new IgramArea(scrollArea, this); - connect(m_igramArea, SIGNAL(imageSize(QString)), this, SLOT(imageSize(QString))); - connect(m_igramArea, SIGNAL(statusBarUpdate(QString,int)), this, SLOT(showMessage(QString, int))); - connect(zernikeProcess::get_Instance(), SIGNAL(statusBarUpdate(QString,int)), this,SLOT(showMessage(QString,int))); - connect(m_igramArea, SIGNAL(upateColorChannels(cv::Mat)), this, SLOT(updateChannels(cv::Mat))); - connect(m_igramArea, SIGNAL(showTab(int)), ui->tabWidget, SLOT(setCurrentIndex(int))); - connect(this, SIGNAL(gammaChanged(bool,double)), m_igramArea, SLOT(gammaChanged(bool, double))); + connect(m_igramArea, &IgramArea::imageSize, this, &MainWindow::imageSize); + connect(m_igramArea, &IgramArea::statusBarUpdate, this, &MainWindow::showMessage); + connect(zernikeProcess::get_Instance(), &zernikeProcess::statusBarUpdate, this,&MainWindow::showMessage); + connect(m_igramArea, &IgramArea::upateColorChannels, this, &MainWindow::updateChannels); + connect(m_igramArea, &IgramArea::showTab, ui->tabWidget, &QTabWidget::setCurrentIndex); + connect(this, &MainWindow::gammaChanged, m_igramArea, &IgramArea::gammaChanged); m_igramArea->setBackgroundRole(QPalette::Base); installEventFilter(m_igramArea); //scrollArea->setBackgroundRole(QPalette::Dark); @@ -125,8 +125,8 @@ MainWindow::MainWindow(QWidget *parent) : scrollAreaDft = new QScrollArea; scrollAreaDft->setBackgroundRole(QPalette::Base); m_dftArea = DFTArea::get_Instance(scrollAreaDft, m_igramArea, m_dftTools, m_vortexDebugTool); - connect(m_dftArea, SIGNAL(statusBarUpdate(QString,int)), this, SLOT(showMessage(QString,int))); - connect(ui->pushButton, SIGNAL(clicked()), m_dftArea, SLOT(outlineDoneSig())); + connect(m_dftArea, &DFTArea::statusBarUpdate, this, &MainWindow::showMessage); + connect(ui->pushButton, &QAbstractButton::clicked, m_dftArea, &DFTArea::outlineDoneSig); scrollAreaDft->setWidget(m_dftArea); scrollAreaDft->resize(800,800); ui->tabWidget->addTab(scrollAreaDft, "Analyze"); @@ -138,28 +138,28 @@ MainWindow::MainWindow(QWidget *parent) : m_regionsEdit = new regionEditTools(this); m_regionsEdit->hide(); m_igramArea->m_regionEdit = m_regionsEdit; - connect(m_regionsEdit, SIGNAL(addregion()),m_igramArea, SLOT(addregion())); - connect(m_regionsEdit, SIGNAL(deleteregion(int)), m_igramArea, SLOT(deleteregion(int))); - connect(m_regionsEdit, SIGNAL(selectRegion(int)), m_igramArea, SLOT(selectRegion(int))); + connect(m_regionsEdit, ®ionEditTools::addregion,m_igramArea, &IgramArea::addregion); + connect(m_regionsEdit, ®ionEditTools::deleteregion, m_igramArea, &IgramArea::deleteregion); + connect(m_regionsEdit, ®ionEditTools::selectRegion, m_igramArea, &IgramArea::selectRegion); //DocWindows createDockWindows(); userMapDlg = new userColorMapDlg(); m_contourView = new contourView(this, m_contourTools); - connect(m_contourView, SIGNAL(zoomMe(bool)),this, SLOT(zoomContour(bool))); + connect(m_contourView, &contourView::zoomMe,this, &MainWindow::zoomContour); m_ogl = new OGLView(0, m_contourTools); - connect(m_ogl, SIGNAL(fullScreen()), this, SLOT(zoomOgl())); + connect(m_ogl, &OGLView::fullScreen, this, &MainWindow::zoomOgl); - connect(userMapDlg, SIGNAL(colorMapChanged(int)), m_contourView->getPlot(), SLOT(ContourMapColorChanged(int))); + connect(userMapDlg, &userColorMapDlg::colorMapChanged, m_contourView->getPlot(), &ContourPlot::ContourMapColorChanged); //connect(userMapDlg, SIGNAL(colorMapChanged(int)),m_ogl->m_gl, SLOT(colorMapChanged(int))); review = new reviewWindow(this); review->s1->addWidget(m_ogl); m_profilePlot = new ProfilePlot(review->s2,m_contourTools); - connect(m_profilePlot, SIGNAL(zoomMe(bool)), this, SLOT(zoomProfile(bool))); - connect(m_profilePlot, SIGNAL(profileAngleChanged(double)), m_contourView->getPlot(), SLOT(drawProfileLine(double))); - connect(m_contourView->getPlot() , SIGNAL(sigPointSelected(QPointF)), m_profilePlot, SLOT(contourPointSelected(QPointF))); + connect(m_profilePlot, &ProfilePlot::zoomMe, this, &MainWindow::zoomProfile); + connect(m_profilePlot, &ProfilePlot::profileAngleChanged, m_contourView->getPlot(), &ContourPlot::drawProfileLine); + connect(m_contourView->getPlot() , &ContourPlot::sigPointSelected, m_profilePlot, &ProfilePlot::contourPointSelected); m_mirrorDlg = mirrorDlg::get_Instance(); review->s2->addWidget(review->s1); review->s2->addWidget(m_profilePlot); @@ -178,11 +178,11 @@ MainWindow::MainWindow(QWidget *parent) : //Surface Manager m_surfaceManager = SurfaceManager::get_instance(this,m_surfTools, m_profilePlot, m_contourView, m_ogl->m_surface, metrics); - connect(m_contourView, SIGNAL(showAllContours()), m_surfaceManager, SLOT(showAllContours())); + connect(m_contourView, &contourView::showAllContours, m_surfaceManager, &SurfaceManager::showAllContours); connect(m_dftArea, SIGNAL(newWavefront(cv::Mat,CircleOutline,CircleOutline,QString, QVector >)), m_surfaceManager, SLOT(createSurfaceFromPhaseMap(cv::Mat,CircleOutline,CircleOutline,QString, QVector >))); - connect(m_surfaceManager, SIGNAL(diameterChanged(double)),this,SLOT(diameterChanged(double))); - connect(m_surfaceManager, SIGNAL(showTab(int)), ui->tabWidget, SLOT(setCurrentIndex(int))); + connect(m_surfaceManager, &SurfaceManager::diameterChanged,this,&MainWindow::diameterChanged); + connect(m_surfaceManager, &SurfaceManager::showTab, ui->tabWidget, &QTabWidget::setCurrentIndex); connect(m_surfTools, SIGNAL(updateSelected()), m_surfaceManager, SLOT(backGroundUpdate())); ui->tabWidget->addTab(review, "Results"); @@ -199,24 +199,24 @@ MainWindow::MainWindow(QWidget *parent) : updateRecentFileActions(); qRegisterMetaType >(); - connect( m_igramArea, SIGNAL(enableShiftButtons(bool)), this,SLOT(enableShiftButtons(bool))); - connect(m_dftArea, SIGNAL(dftReady(QImage)), m_igramArea,SLOT(dftReady(QImage))); - connect(m_igramArea, SIGNAL(dftCenterFilter(double)), m_dftArea, SLOT(dftCenterFilter(double))); - connect(m_igramArea, SIGNAL(doDFT()), m_dftArea, SLOT(doDFT())); + connect( m_igramArea, &IgramArea::enableShiftButtons, this,&MainWindow::enableShiftButtons); + connect(m_dftArea, &DFTArea::dftReady, m_igramArea,&IgramArea::dftReady); + connect(m_igramArea, &IgramArea::dftCenterFilter, m_dftArea, &DFTArea::dftCenterFilter); + connect(m_igramArea, &IgramArea::doDFT, m_dftArea, &DFTArea::doDFT); enableShiftButtons(true); QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_I), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(importIgram())); + QObject::connect(shortcut, &QShortcut::activated, this, &MainWindow::importIgram); QShortcut *shortcutl = new QShortcut(QKeySequence(Qt::Key_L), this); - QObject::connect(shortcutl, SIGNAL(activated()), this, SLOT(on_actionLoad_Interferogram_triggered())); + QObject::connect(shortcutl, &QShortcut::activated, this, &MainWindow::on_actionLoad_Interferogram_triggered); QShortcut *shortcut1 = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_O), this); - QObject::connect(shortcut1, SIGNAL(activated()), this, SLOT(on_actionLoad_Interferogram_triggered())); + QObject::connect(shortcut1, &QShortcut::activated, this, &MainWindow::on_actionLoad_Interferogram_triggered); - connect(m_dftTools,SIGNAL(doDFT()),m_dftArea,SLOT(doDFT())); + connect(m_dftTools,&DFTTools::doDFT,m_dftArea,&DFTArea::doDFT); settingsDlg = Settings2::getInstance(); - connect(settingsDlg->m_igram, SIGNAL(igramLinesChanged(outlineParms)), m_igramArea, SLOT(igramOutlineParmsChanged(outlineParms))); + connect(settingsDlg->m_igram, &settingsIGram::igramLinesChanged, m_igramArea, &IgramArea::igramOutlineParmsChanged); connect(settingsDlg->m_general, SIGNAL(updateContourPlot()),m_contourView, SLOT(updateRuler())); QSettings settings; @@ -224,8 +224,8 @@ MainWindow::MainWindow(QWidget *parent) : restoreState(settings.value("MainWindow/windowState").toByteArray()); restoreGeometry(settings.value("geometry").toByteArray()); - connect(m_dftArea,SIGNAL(selectDFTTab()), this, SLOT(selectDftTab())); - connect(ui->tabWidget,SIGNAL(currentChanged(int)),this, SLOT(mainTabChanged(int))); + connect(m_dftArea,&DFTArea::selectDFTTab, this, &MainWindow::selectDftTab); + connect(ui->tabWidget,&QTabWidget::currentChanged,this, &MainWindow::mainTabChanged); tabifyDockWidget(ui->outlineTools, m_dftTools); setTabPosition(Qt::RightDockWidgetArea, QTabWidget::West); setTabShape(QTabWidget::Triangular); @@ -251,8 +251,8 @@ MainWindow::MainWindow(QWidget *parent) : zernEnables[i] = false; } - connect(m_surfaceManager, SIGNAL(rocChanged(double)),this, SLOT(rocChanged(double))); - connect(m_mirrorDlg, SIGNAL(newPath(QString)),this, SLOT(newMirrorDlgPath(QString))); + connect(m_surfaceManager, &SurfaceManager::rocChanged,this, &MainWindow::rocChanged); + connect(m_mirrorDlg, &mirrorDlg::newPath,this, &MainWindow::newMirrorDlgPath); progBar = new QProgressBar(this); status1 = new QLabel(); @@ -492,8 +492,8 @@ void MainWindow::createActions() for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); - connect(recentFileActs[i], SIGNAL(triggered()), - this, SLOT(openRecentFile())); + connect(recentFileActs[i], &QAction::triggered, + this, &MainWindow::openRecentFile); } } @@ -1061,15 +1061,15 @@ void MainWindow::batchConnections(bool flag){ qDebug() << "BatchConnection " << flag; if (flag){ m_inBatch = true; - disconnect(m_dftTools, SIGNAL(makeSurface()), m_dftArea, SIGNAL(makeSurface())); - connect(m_dftTools, SIGNAL(makeSurface()), this, SLOT(batchMakeSurfaceReady())); - connect(batchIgramWizard::saveZerns, SIGNAL(pressed()), this, SLOT(saveBatchZerns())); + disconnect(m_dftTools, &DFTTools::makeSurface, m_dftArea, &DFTArea::makeSurface); + connect(m_dftTools, &DFTTools::makeSurface, this, &MainWindow::batchMakeSurfaceReady); + connect(batchIgramWizard::saveZerns, &QAbstractButton::pressed, this, &MainWindow::saveBatchZerns); } else { m_inBatch = false; - connect(m_dftTools, SIGNAL(makeSurface()), m_dftArea, SLOT(makeSurface())); - disconnect(m_dftTools, SIGNAL(makeSurface()), this, SLOT(batchMakeSurfaceReady())); - disconnect(batchIgramWizard::saveZerns, SIGNAL(pressed()), this, SLOT(saveBatchZerns())); + connect(m_dftTools, &DFTTools::makeSurface, m_dftArea, &DFTArea::makeSurface); + disconnect(m_dftTools, &DFTTools::makeSurface, this, &MainWindow::batchMakeSurfaceReady); + disconnect(batchIgramWizard::saveZerns, &QAbstractButton::pressed, this, &MainWindow::saveBatchZerns); } } void MainWindow::saveBatchZerns(){ @@ -1307,7 +1307,7 @@ void MainWindow::Batch_Process_Interferograms() batchWiz = new batchIgramWizard(m_igramsToProcess, this,Qt::Window); batchConnections(true); //connect(batchIgramWizard::goPb, &QPushButton::pressed, this, &MainWindow::batchProcess); - connect(batchWiz, SIGNAL(finished(int)), this, SLOT(batchFinished(int))); + connect(batchWiz, &QDialog::finished, this, &MainWindow::batchFinished); batchWiz->show(); } @@ -1328,7 +1328,7 @@ void MainWindow::on_actionVersion_History_triggered() void MainWindow::on_actionIterate_outline_triggered() { jitterOutlineDlg *dlg = jitterOutlineDlg::getInstance(this); - connect(dlg,SIGNAL(finished(int)),this,SLOT(stopJitter())); + connect(dlg,&QDialog::finished,this,&MainWindow::stopJitter); dlg->show(); } static bool stopJittering = false; @@ -1442,7 +1442,7 @@ void MainWindow::zoomProfile(bool flag){ } profileFv = new QWidget(0); profileFv->setAttribute( Qt::WA_DeleteOnClose ); - connect(profileFv,SIGNAL(destroyed(QObject*)),this, SLOT(restoreProfile())); + connect(profileFv,&QObject::destroyed,this, &MainWindow::restoreProfile); QVBoxLayout *l = new QVBoxLayout(); l->addWidget(m_profilePlot); m_profilePlot->setMinimumHeight(300); @@ -1457,7 +1457,7 @@ void MainWindow::zoomContour(bool flag){ } contourFv = new QWidget(0); contourFv->setAttribute( Qt::WA_DeleteOnClose ); - connect(contourFv,SIGNAL(destroyed(QObject*)),this, SLOT(restoreContour())); + connect(contourFv,&QObject::destroyed,this, &MainWindow::restoreContour); QVBoxLayout *l = new QVBoxLayout(); l->addWidget(m_contourView); m_contourView->setMinimumHeight(300); @@ -1470,7 +1470,7 @@ void MainWindow::zoomOgl() oglFv = new QWidget(0); oglFv->setAttribute( Qt::WA_DeleteOnClose ); - connect(oglFv,SIGNAL(destroyed(QObject*)),this, SLOT(restoreOgl())); + connect(oglFv,&QObject::destroyed,this, &MainWindow::restoreOgl); QVBoxLayout *l = new QVBoxLayout(); //m_ogl->setMinimumHeight(300); l->addWidget(m_ogl); @@ -1495,7 +1495,7 @@ void MainWindow::on_actionEdit_Zernike_values_triggered() dlg->setWindowFlags(Qt::Tool); dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->show(); - connect(dlg, SIGNAL(termCountChanged(int)), metrics, SLOT(resizeRows(int))); + connect(dlg, &zernikeEditDlg::termCountChanged, metrics, &metricsDisplay::resizeRows); } void MainWindow::on_actionCamera_Calibration_triggered() @@ -1797,7 +1797,7 @@ void MainWindow::on_actionCreate_Movie_of_wavefronts_triggered() qDebug() << "plain text"<< text; QApplication::setOverrideCursor(Qt::WaitCursor); QProcess *proc = new QProcess; - QObject::connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), proc, SLOT(deleteLater())); + QObject::connect(proc, &QProcess::finished, proc, &QObject::deleteLater); connect(proc, QOverload::of(&QProcess::finished), [=](int exitCode, QProcess::ExitStatus exitStatus){ qDebug() << "what" << exitStatus << "code" << exitCode; }); @@ -1824,7 +1824,7 @@ void MainWindow::on_actionCreate_Movie_of_wavefronts_triggered() }); QEventLoop loop; - QObject::connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), &loop, SLOT(quit())); + QObject::connect(proc, &QProcess::finished, &loop, &QEventLoop::quit); loop.exec(); qDebug() << "done" ; diff --git a/mirrordlg.cpp b/mirrordlg.cpp index 0b8f0adb..6d21d443 100644 --- a/mirrordlg.cpp +++ b/mirrordlg.cpp @@ -109,7 +109,7 @@ mirrorDlg::mirrorDlg(QWidget *parent) : ui->fringeSpacingEdit->blockSignals(false); m_outlineShape = (outlineShape)settings.value("outlineShape", CIRCLE).toInt(); ui->minorAxisEdit->setText(QString::number(settings.value("ellipseMinorAxis", 50.).toDouble())); - connect(&spacingChangeTimer, SIGNAL(timeout()), this, SLOT(spacingChangeTimeout())); + connect(&spacingChangeTimer, &QTimer::timeout, this, &mirrorDlg::spacingChangeTimeout); if (m_verticalAxis == 0) m_verticalAxis = diameter; ui->ellipseShape->setChecked(m_outlineShape == ELLIPSE); diff --git a/nullvariationdlg.cpp b/nullvariationdlg.cpp index 20726d91..a0612b0f 100644 --- a/nullvariationdlg.cpp +++ b/nullvariationdlg.cpp @@ -47,7 +47,7 @@ nullVariationDlg::nullVariationDlg(QWidget *parent) : vLayout->addWidget(histo_plot); ui->histoPlot->setLayout(vLayout); qDebug() << ui->roc->text(); - connect(&m_guiTimer, SIGNAL(timeout()), this, SLOT(on_ComputeSim_clicked())); + connect(&m_guiTimer, &QTimer::timeout, this, &nullVariationDlg::on_ComputeSim_clicked); calculate(); } diff --git a/oglview.cpp b/oglview.cpp index ca4df6c6..8e5f3ca8 100644 --- a/oglview.cpp +++ b/oglview.cpp @@ -85,19 +85,19 @@ OGLView::OGLView(QWidget *parent, ContourTools *m_tool) : lh->addWidget(saveImagePb); lh->addWidget(showSelectedPb); lh->addWidget(m_fullScreenPb); - connect(lightingPb, SIGNAL(pressed()), this,SLOT(openLightDlg())); - connect(saveImagePb, SIGNAL(pressed()), this, SLOT(saveImage())); - connect(showSelectedPb, SIGNAL(pressed()), this, SLOT(showSelected())); - connect(m_tool,SIGNAL(ContourMapColorChanged(int)), m_surface, SLOT(setColorMap(int))); - connect(m_fullScreenPb, SIGNAL(pressed()), this, SLOT(fullScreenPressed())); + connect(lightingPb, &QAbstractButton::pressed, this,&OGLView::openLightDlg); + connect(saveImagePb, &QAbstractButton::pressed, this, &OGLView::saveImage); + connect(showSelectedPb, &QAbstractButton::pressed, this, &OGLView::showSelected); + connect(m_tool,&ContourTools::ContourMapColorChanged, m_surface, &SurfaceGraph::setColorMap); + connect(m_fullScreenPb, &QAbstractButton::pressed, this, &OGLView::fullScreenPressed); lh->addStretch(); lv->addWidget(m_container); topH->addLayout(lv,10); topH->addLayout(rightcontrols,1); setLayout(topH); setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(showContextMenu(QPoint))); + connect(this, &QWidget::customContextMenuRequested, this, + &OGLView::showContextMenu); } OGLView::~OGLView(){ m_controls->close(); @@ -113,7 +113,7 @@ void OGLView::showContextMenu(QPoint pos) // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("FullScreen", this, SLOT(fullScreenPressed())); + myMenu.addAction("FullScreen", this, &OGLView::fullScreenPressed); // Show context menu at handling position myMenu.exec(globalPos); diff --git a/outlinedialog.cpp b/outlinedialog.cpp index 4858d3de..2039436b 100644 --- a/outlinedialog.cpp +++ b/outlinedialog.cpp @@ -42,17 +42,17 @@ outlineDialog::outlineDialog(double x, double y, double rad, QWidget *parent) : ui->showEdgePixelsCB->blockSignals(false); hideSearchcontrole(true); QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_Down), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftDown())); + QObject::connect(shortcut, &QShortcut::activated, this, &outlineDialog::shiftDown); shortcut = new QShortcut(QKeySequence(Qt::Key_Up), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftUp())); + QObject::connect(shortcut, &QShortcut::activated, this, &outlineDialog::shiftUp); shortcut = new QShortcut(QKeySequence(Qt::Key_Left), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftLeft())); + QObject::connect(shortcut, &QShortcut::activated, this, &outlineDialog::shiftLeft); shortcut = new QShortcut(QKeySequence(Qt::Key_Right), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(shiftRight())); + QObject::connect(shortcut, &QShortcut::activated, this, &outlineDialog::shiftRight); shortcut = new QShortcut(QKeySequence(Qt::Key_Minus), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(decrease())); + QObject::connect(shortcut, &QShortcut::activated, this, &outlineDialog::decrease); shortcut = new QShortcut(QKeySequence(Qt::Key_Plus), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(increase())); + QObject::connect(shortcut, &QShortcut::activated, this, &outlineDialog::increase); //ui->display->resize(QSize(height - 100, height - 100)); } void outlineDialog::shiftDown(){ diff --git a/pixelstats.cpp b/pixelstats.cpp index efe5e31e..0d770f6b 100644 --- a/pixelstats.cpp +++ b/pixelstats.cpp @@ -283,7 +283,7 @@ pixelStats::pixelStats(QWidget *parent) : ui->verticalLayout->addWidget(scrollArea); scrollArea->setWidgetResizable(true); CanvasPicker *cp = new CanvasPicker(ui->histo); - connect(cp,SIGNAL(markerMoved()), this,SLOT(bounds_valueChanged())); + connect(cp,&CanvasPicker::markerMoved, this,&pixelStats::bounds_valueChanged); setWindowFlags( Qt::WindowStaysOnTopHint); diff --git a/profileplot.cpp b/profileplot.cpp index e32e4833..9b82fcfb 100644 --- a/profileplot.cpp +++ b/profileplot.cpp @@ -71,7 +71,7 @@ ProfilePlot::ProfilePlot(QWidget *parent , ContourTools *tools): { m_pcdlg = new percentCorrectionDlg; - QObject::connect(m_pcdlg, SIGNAL(make_percent_correction()), this, SLOT(make_correction_graph())); + QObject::connect(m_pcdlg, &percentCorrectionDlg::make_percent_correction, this, &ProfilePlot::make_correction_graph); zoomed = false; m_defocus_mode = false; m_plot = new QwtPlot(this); @@ -85,9 +85,9 @@ ProfilePlot::ProfilePlot(QWidget *parent , ContourTools *tools): OneOnly = new QRadioButton("one diameter of current wavefront",this); OneOnly->setChecked(true); ShowAll = new QRadioButton("All wavefronts",this); - connect(Show16, SIGNAL(clicked()), this, SLOT(show16())); - connect(OneOnly, SIGNAL(clicked()), this, SLOT(showOne())); - connect(ShowAll, SIGNAL(clicked()), this, SLOT(showAll())); + connect(Show16, &QAbstractButton::clicked, this, &ProfilePlot::show16); + connect(OneOnly, &QAbstractButton::clicked, this, &ProfilePlot::showOne); + connect(ShowAll, &QAbstractButton::clicked, this, &ProfilePlot::showAll); l1->addStretch(); showSlopeError = new QCheckBox("Show Slope: "); showPercentCorrection = new QPushButton("Show Correction"); @@ -112,9 +112,9 @@ ProfilePlot::ProfilePlot(QWidget *parent , ContourTools *tools): if (!m_showSlopeError) slopeLimitSB->hide(); showSlopeError->setChecked(m_showSlopeError); - connect(slopeLimitSB, SIGNAL(valueChanged(double)), this, SLOT(slopeLimit(double))); - connect(showSlopeError,SIGNAL(clicked(bool)), this, SLOT(showSlope(bool))); - connect(showPercentCorrection,SIGNAL(clicked()), this, SLOT(showCorrection())); + connect(slopeLimitSB, &QDoubleSpinBox::valueChanged, this, &ProfilePlot::slopeLimit); + connect(showSlopeError,&QAbstractButton::clicked, this, &ProfilePlot::showSlope); + connect(showPercentCorrection,&QAbstractButton::clicked, this, &ProfilePlot::showCorrection); l1->addWidget(showPercentCorrection); l1->addWidget(showSlopeError); l1->addWidget(slopeLimitSB); @@ -192,12 +192,12 @@ ProfilePlot::ProfilePlot(QWidget *parent , ContourTools *tools): // new QwtCompassMagnetNeedle( QwtCompassMagnetNeedle::ThinStyle ) ); compass->setValue( 270 ); compass->setOrigin( -90 ); - connect(compass,SIGNAL(valueChanged(double)),this ,SLOT(angleChanged(double))); - connect(m_tools, SIGNAL(newDisplayErrorRange(double,double)), - this, SLOT(newDisplayErrorRange(double,double))); - connect(m_tools, SIGNAL(contourZeroOffsetChanged(QString)), this, SLOT(zeroOffsetChanged(QString))); - connect(showNmCB, SIGNAL(clicked(bool)), this, SLOT(showNm(bool))); - connect(showSurfaceCB, SIGNAL(clicked(bool)),this, SLOT(showSurface(bool))); + connect(compass,&QwtAbstractSlider::valueChanged,this ,&ProfilePlot::angleChanged); + connect(m_tools, &ContourTools::newDisplayErrorRange, + this, &ProfilePlot::newDisplayErrorRange); + connect(m_tools, &ContourTools::contourZeroOffsetChanged, this, &ProfilePlot::zeroOffsetChanged); + connect(showNmCB, &QAbstractButton::clicked, this, &ProfilePlot::showNm); + connect(showSurfaceCB, &QAbstractButton::clicked,this, &ProfilePlot::showSurface); ui->setupUi(this); populate(); @@ -765,7 +765,7 @@ void ProfilePlot::showContextMenu(QPoint pos) // Create menu and insert some actions QMenu myMenu; QString txt = (zoomed)? "Restore to MainWindow" : "FullScreen"; - myMenu.addAction(txt, this, SLOT(zoom())); + myMenu.addAction(txt, this, &ProfilePlot::zoom); // Show context menu at handling position myMenu.exec(globalPos); diff --git a/settingsgeneral2.cpp b/settingsgeneral2.cpp index 481567a1..2ebccfbc 100644 --- a/settingsgeneral2.cpp +++ b/settingsgeneral2.cpp @@ -61,7 +61,7 @@ void SettingsGeneral2::updateContour(){ void SettingsGeneral2::on_rulerParms_clicked(){ ContourRulerParams dlg; - connect(&dlg, SIGNAL(updateParms()), this, SLOT(updateContour())); + connect(&dlg, &ContourRulerParams::updateParms, this, &SettingsGeneral2::updateContour); dlg.exec(); } diff --git a/settingsigram.cpp b/settingsigram.cpp index 528df00b..eaecb490 100644 --- a/settingsigram.cpp +++ b/settingsigram.cpp @@ -52,7 +52,7 @@ settingsIGram::settingsIGram(QWidget *parent) : ui->centerSpinBox->setValue(centerWidth); ui->zoomBoxWidthSb->setValue(set.value("igramZoomBoxWidth", 200).toDouble()); - connect(ui->buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(on_buttonBox_accepted())); + connect(ui->buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &settingsIGram::on_buttonBox_accepted); ui->styleCB->setEditable(false); ui->styleCB->setIconSize(QSize(80,14)); ui->styleCB->setMinimumWidth(80); @@ -103,7 +103,7 @@ settingsIGram::settingsIGram(QWidget *parent) : ui->currentlense->setText(m_lenseParms[0]); } ui->lenseTableView->setContextMenuPolicy(Qt::CustomContextMenu); - connect(ui->lenseTableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); + connect(ui->lenseTableView, &QWidget::customContextMenuRequested, this, &settingsIGram::showContextMenu); ui->lenseTableView->selectRow(currentLensNdx); ui->lenseTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); selectionModel = ui->lenseTableView->selectionModel(); @@ -191,7 +191,7 @@ void settingsIGram::showContextMenu(QPoint pos) // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("Erase", this, SLOT(eraseItem())); + myMenu.addAction("Erase", this, &settingsIGram::eraseItem); // Show context menu at handling position myMenu.exec(globalPos); diff --git a/simulationsview.cpp b/simulationsview.cpp index 5e1e555c..ad0777b5 100644 --- a/simulationsview.cpp +++ b/simulationsview.cpp @@ -92,9 +92,9 @@ SimulationsView::SimulationsView(QWidget *parent) : ui->FFTSizeSB->blockSignals(false); ui->centerMagnifySB->setValue(set.value("StarTestMagnify", 4).toDouble()); ui->gammaSB->setValue(set.value("StarTestGamma", 2.).toDouble()); - connect(&m_guiTimer, SIGNAL(timeout()), this, SLOT(on_MakePB_clicked())); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(showContextMenu(QPoint))); + connect(&m_guiTimer, &QTimer::timeout, this, &SimulationsView::on_MakePB_clicked); + connect(this, &QWidget::customContextMenuRequested, this, + &SimulationsView::showContextMenu); setContextMenuPolicy(Qt::CustomContextMenu); } diff --git a/standastigwizard.cpp b/standastigwizard.cpp index 44a8e416..b610a5c2 100644 --- a/standastigwizard.cpp +++ b/standastigwizard.cpp @@ -175,7 +175,7 @@ void define_input::showContextMenu(QPoint pos) // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("Erase", this, SLOT(deleteSelected())); + myMenu.addAction("Erase", this, &define_input::deleteSelected); // Show context menu at handling position myMenu.exec(globalPos); @@ -189,12 +189,12 @@ define_input::define_input(QWidget *parent) setSubTitle(tr("Add each averaged wavefront for each rotation angle. Then Press Compute.")); browsePb = new QPushButton("Add average Wavefront file to List"); QString pdfNameStr = set.value("stand pdf file", "stand.pdf").toString(); - connect(browsePb, SIGNAL(pressed()), this, SLOT(browse())); + connect(browsePb, &QAbstractButton::pressed, this, &define_input::browse); AstigReportTitle = mirrorDlg::get_Instance()->m_name; AstigReportPdfName = mirrorDlg::get_Instance()->getProjectPath() + "/" + pdfNameStr; title = new QLineEdit(AstigReportTitle); pdfName = new QPushButton(AstigReportPdfName); - connect(pdfName, SIGNAL(pressed()), this, SLOT(pdfNamesPressed())); + connect(pdfName, &QAbstractButton::pressed, this, &define_input::pdfNamesPressed); runpb = new QPushButton("Compute"); runpb->setObjectName("Compute"); @@ -225,7 +225,7 @@ define_input::define_input(QWidget *parent) " }"); - connect(runpb, SIGNAL(pressed()), this, SLOT(compute())); + connect(runpb, &QAbstractButton::pressed, this, &define_input::compute); QSettings settings; QString lastPath = settings.value("projectPath","").toString(); basePath = new QLineEdit(settings.value("rotation base path",lastPath).toString()); @@ -238,7 +238,7 @@ define_input::define_input(QWidget *parent) else CWRb->setChecked(true); - connect(browsePath, SIGNAL(pressed()), this, SLOT(setBasePath())); + connect(browsePath, &QAbstractButton::pressed, this, &define_input::setBasePath); @@ -264,8 +264,8 @@ define_input::define_input(QWidget *parent) // listDisplay->addItem(set.value("item").toString()); // } set.endArray(); - connect(listDisplay, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(showContextMenu(QPoint))); + connect(listDisplay, &QWidget::customContextMenuRequested, this, + &define_input::showContextMenu); l->addWidget(listDisplay,8,0,10,-1); l->addWidget(new QLabel("Report Title:"),18,0); diff --git a/surfaceanalysistools.cpp b/surfaceanalysistools.cpp index 76c11646..da741b54 100644 --- a/surfaceanalysistools.cpp +++ b/surfaceanalysistools.cpp @@ -52,9 +52,9 @@ surfaceAnalysisTools::surfaceAnalysisTools(QWidget *parent) : ui->blurCB->setCheckState((ch) ? Qt::Checked : Qt::Unchecked); m_useDefocus = false; m_defocus = 0.; - connect(&m_defocusTimer, SIGNAL(timeout()), this, SLOT(defocusTimerDone())); - connect(ui->wavefrontList->itemDelegate(), SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), this, - SLOT(ListWidgetEditEnd(QWidget*, QAbstractItemDelegate::EndEditHint))); + connect(&m_defocusTimer, &QTimer::timeout, this, &surfaceAnalysisTools::defocusTimerDone); + connect(ui->wavefrontList->itemDelegate(), &QAbstractItemDelegate::closeEditor, this, + &surfaceAnalysisTools::ListWidgetEditEnd); ui->wavefrontList->setContextMenuPolicy(Qt::CustomContextMenu); QShortcut* delShortcut = new QShortcut(QKeySequence::Delete, this); connect(delShortcut, &QShortcut::activated, this, &surfaceAnalysisTools::on_deleteWave_clicked); @@ -345,8 +345,8 @@ void surfaceAnalysisTools::on_defocus_clicked() emit defocusSetup(); defocusDlg *dlg = new defocusDlg(); - connect(dlg, SIGNAL(defocus(double)), this, SLOT(defocusControlChanged(double))); - connect(dlg, SIGNAL(finished(int)), this, SLOT(closeDefocus(int)) ); + connect(dlg, &defocusDlg::defocus, this, &surfaceAnalysisTools::defocusControlChanged); + connect(dlg, &QDialog::finished, this, &surfaceAnalysisTools::closeDefocus ); dlg->show(); return; diff --git a/surfacemanager.cpp b/surfacemanager.cpp index 9bcb05b0..13d9307f 100644 --- a/surfacemanager.cpp +++ b/surfacemanager.cpp @@ -502,36 +502,36 @@ SurfaceManager::SurfaceManager(QObject *parent, surfaceAnalysisTools *tools, pd = new QProgressDialog(); pd->reset(); - connect (this,SIGNAL(progress(int)), pd, SLOT(setValue(int))); + connect (this,&SurfaceManager::progress, pd, &QProgressDialog::setValue); m_profilePlot->setWavefronts(&m_wavefronts); // create a timer for surface change update to all non current wave fronts m_waveFrontTimer = new QTimer(this); m_toolsEnableTimer = new QTimer(this); // setup signal and slot - connect(m_waveFrontTimer, SIGNAL(timeout()),this, SLOT(backGroundUpdate())); - connect(m_toolsEnableTimer, SIGNAL(timeout()), this, SLOT(enableTools())); - - connect(m_surfaceTools, SIGNAL(waveFrontClicked(int)), this, SLOT(waveFrontClickedSlot(int))); - connect(m_surfaceTools, SIGNAL(centerMaskValue(int)),this, SLOT(centerMaskValue(int))); - connect(m_surfaceTools, SIGNAL(outsideMaskValue(int)),this, SLOT(outsideMaskValue(int))); - connect(m_surfaceTools, SIGNAL(surfaceSmoothGBEnabled(bool)), this, SLOT(surfaceSmoothGBEnabled(bool))); - connect(m_surfaceTools, SIGNAL(surfaceSmoothGBValue(double)), this, SLOT(surfaceSmoothGBValue(double))); - connect(m_surfaceTools, SIGNAL(wftNameChanged(int,QString)), this, SLOT(wftNameChanged(int,QString))); + connect(m_waveFrontTimer, &QTimer::timeout,this, &SurfaceManager::backGroundUpdate); + connect(m_toolsEnableTimer, &QTimer::timeout, this, &SurfaceManager::enableTools); + + connect(m_surfaceTools, &surfaceAnalysisTools::waveFrontClicked, this, &SurfaceManager::waveFrontClickedSlot); + connect(m_surfaceTools, &surfaceAnalysisTools::centerMaskValue,this, &SurfaceManager::centerMaskValue); + connect(m_surfaceTools, &surfaceAnalysisTools::outsideMaskValue,this, &SurfaceManager::outsideMaskValue); + connect(m_surfaceTools, &surfaceAnalysisTools::surfaceSmoothGBEnabled, this, &SurfaceManager::surfaceSmoothGBEnabled); + connect(m_surfaceTools, &surfaceAnalysisTools::surfaceSmoothGBValue, this, &SurfaceManager::surfaceSmoothGBValue); + connect(m_surfaceTools, &surfaceAnalysisTools::wftNameChanged, this, &SurfaceManager::wftNameChanged); connect(this, SIGNAL(nameChanged(QString, QString)), m_surfaceTools, SLOT(nameChanged(QString,QString))); - connect(m_metrics, SIGNAL(recomputeZerns()), this, SLOT(computeZerns())); - connect(m_surfaceTools, SIGNAL(defocusChanged()), this, SLOT(defocusChanged())); - connect(m_surfaceTools, SIGNAL(defocusSetup()), this, SLOT(defocusSetup())); - connect(this, SIGNAL(currentNdxChanged(int)), m_surfaceTools, SLOT(currentNdxChanged(int))); - connect(this, SIGNAL(deleteWavefront(int)), m_surfaceTools, SLOT(deleteWaveFront(int))); + connect(m_metrics, &metricsDisplay::recomputeZerns, this, &SurfaceManager::computeZerns); + connect(m_surfaceTools, &surfaceAnalysisTools::defocusChanged, this, &SurfaceManager::defocusChanged); + connect(m_surfaceTools, &surfaceAnalysisTools::defocusSetup, this, &SurfaceManager::defocusSetup); + connect(this, &SurfaceManager::currentNdxChanged, m_surfaceTools, &surfaceAnalysisTools::currentNdxChanged); + connect(this, &SurfaceManager::deleteWavefront, m_surfaceTools, &surfaceAnalysisTools::deleteWaveFront); connect(m_surfaceTools, SIGNAL(deleteTheseWaveFronts(QList)), this, SLOT(deleteWaveFronts(QList))); connect(m_surfaceTools, SIGNAL(average(QList)),this, SLOT(average(QList))); connect(m_surfaceTools, SIGNAL(doxform(QList)),this, SLOT(transfrom(QList))); connect(m_surfaceTools, SIGNAL(invert(QList)),this,SLOT(invert(QList))); - connect(m_surfaceTools, SIGNAL(filterWavefronts()),this,SLOT(filter())); - connect(this, SIGNAL(enableControls(bool)),m_surfaceTools, SLOT(enableControls(bool))); - connect(mirrorDlg::get_Instance(),SIGNAL(recomputeZerns()), this, SLOT(computeZerns())); - connect(mirrorDlg::get_Instance(),SIGNAL(obstructionChanged()), this, SLOT(ObstructionChanged())); + connect(m_surfaceTools, &surfaceAnalysisTools::filterWavefronts,this,&SurfaceManager::filter); + connect(this, &SurfaceManager::enableControls,m_surfaceTools, &surfaceAnalysisTools::enableControls); + connect(mirrorDlg::get_Instance(),&mirrorDlg::recomputeZerns, this, &SurfaceManager::computeZerns); + connect(mirrorDlg::get_Instance(),&mirrorDlg::obstructionChanged, this, &SurfaceManager::ObstructionChanged); QSettings settings; m_GB_enabled = settings.value("GBlur", true).toBool(); if (!settings.contains("gaussianRadiusConverted")){ @@ -540,7 +540,7 @@ SurfaceManager::SurfaceManager(QObject *parent, surfaceAnalysisTools *tools, } m_gbValue = settings.value("GBValue", 20).toInt(); //useDemoWaveFront(); - connect(Settings2::getInstance()->m_general, SIGNAL(outputLambdaChanged(double)), this, SLOT(outputLambdaChanged(double))); + connect(Settings2::getInstance()->m_general, &SettingsGeneral2::outputLambdaChanged, this, &SurfaceManager::outputLambdaChanged); outputLambda = settings.value("outputLambda", 550.).toDouble(); //useDemoWaveFront(); surfaceSmoothGBValue(m_gbValue); @@ -1629,7 +1629,7 @@ void SurfaceManager::averageComplete(wavefront *wf){ void SurfaceManager::averageWavefrontFiles(const QStringList &files){ averageWaveFrontFilesDlg dlg(files, this); - connect(&dlg, SIGNAL(averageComplete(wavefront*)), this, SLOT(averageComplete(wavefront *))); + connect(&dlg, &averageWaveFrontFilesDlg::averageComplete, this, &SurfaceManager::averageComplete); if (dlg.exec()){ } @@ -1831,7 +1831,7 @@ void SurfaceManager::invert(QList list){ void SurfaceManager::filter(){ wavefrontFilterDlg dlg; dlg.setRemoveFileMode(); - connect(&dlg, SIGNAL(waveWasSelected(QString)),this, SLOT(wavefrontDClicked(QString))); + connect(&dlg, &wavefrontFilterDlg::waveWasSelected,this, &SurfaceManager::wavefrontDClicked); for (int ndx= 0; ndx < m_wavefronts.size(); ++ndx) { wavefront *wf = m_wavefronts[ndx]; @@ -2758,7 +2758,7 @@ void SurfaceManager::showAllContours(){ scrollArea->setAutoFillBackground(true); QPushButton *savePb = new QPushButton("Save as Image",w); - connect(savePb, SIGNAL(pressed()), this, SLOT(saveAllContours())); + connect(savePb, &QAbstractButton::pressed, this, &SurfaceManager::saveAllContours); layout->addWidget(savePb,0,Qt::AlignHCenter); layout->addWidget(scrollArea); w->setLayout(layout); @@ -3059,7 +3059,7 @@ void SurfaceManager::transform(){ TransformWaveFrontDlg dlg; connect(&dlg, SIGNAL(flipLR()), this, SLOT(flipHorizontal())); connect(&dlg, SIGNAL(flipV()),this, SLOT(flipVertical())); - connect(&dlg, SIGNAL(resizeW(int)), this, SLOT(resizeW(int))); + connect(&dlg, &TransformWaveFrontDlg::resizeW, this, &SurfaceManager::resizeW); connect(&dlg, SIGNAL(changeWavelength(double)), this, SLOT(changeWavelength(double))); dlg.exec(); diff --git a/wavefrontfilterdlg.cpp b/wavefrontfilterdlg.cpp index cfa82797..e8d3199a 100644 --- a/wavefrontfilterdlg.cpp +++ b/wavefrontfilterdlg.cpp @@ -8,9 +8,9 @@ wavefrontFilterDlg::wavefrontFilterDlg(QWidget *parent) : ui->setupUi(this); ui->deleteFile->hide(); ui->astigPlot->hide(); - connect(ui->astigPlot, SIGNAL(waveSeleted(QString)), this, SLOT(waveSelected(QString))); + connect(ui->astigPlot, &astigScatterPlot::waveSeleted, this, &wavefrontFilterDlg::waveSelected); ui->rmSPlot->hide(); - connect(ui->rmSPlot, SIGNAL(waveSeleted(QString)), this, SLOT(waveSelected(QString))); + connect(ui->rmSPlot, &rmsPlot::waveSeleted, this, &wavefrontFilterDlg::waveSelected); QSettings set; ui->rmsValue->blockSignals(true); ui->rmsValue->setValue(set.value("filterRMS", .1).toDouble()); diff --git a/wavefrontloader.cpp b/wavefrontloader.cpp index 5a0101bc..7a1b51bd 100644 --- a/wavefrontloader.cpp +++ b/wavefrontloader.cpp @@ -21,10 +21,10 @@ waveFrontLoader::waveFrontLoader(QObject *parent) : QObject(parent), done(true),shouldCancel(false) { pd = new QProgressDialog(" Loading wavefronts in PRogress.", "Cancel", 0, 100); - connect(pd, SIGNAL(canceled()), this, SLOT(cancel())); - connect(this, SIGNAL(status(int)), pd, SLOT(setValue(int))); - connect(this, SIGNAL(progressRange(int,int)), pd, SLOT(setRange(int,int))); - connect(this, SIGNAL(currentWavefront(QString)), pd, SLOT(setLabelText(QString))); + connect(pd, &QProgressDialog::canceled, this, &waveFrontLoader::cancel); + connect(this, &waveFrontLoader::status, pd, &QProgressDialog::setValue); + connect(this, &waveFrontLoader::progressRange, pd, &QProgressDialog::setRange); + connect(this, &waveFrontLoader::currentWavefront, pd, &QProgressDialog::setLabelText); } void waveFrontLoader::addWavefront(const QString &filename){ diff --git a/zernikesmoothingdlg.cpp b/zernikesmoothingdlg.cpp index 7b30443d..47f06c16 100644 --- a/zernikesmoothingdlg.cpp +++ b/zernikesmoothingdlg.cpp @@ -24,7 +24,7 @@ ZernikeSmoothingDlg::ZernikeSmoothingDlg(wavefront &wf, QWidget *parent) : m_maxOrder = set.value("Zern maxOrder", 22).toInt(); ui->maxOrder->setValue(m_maxOrder); ui->termCnt->setText(QString("%1 Terms").arg(m_noOfTerms)); - connect(&m_timer, SIGNAL(timeout()), this, SLOT(intiZernTable())); + connect(&m_timer, &QTimer::timeout, this, &ZernikeSmoothingDlg::intiZernTable); tableModel->setValues(&m_wf.InputZerns); m_sm = SurfaceManager::get_instance(); From 81d8ad27a2f03b54ed5ef3712831d84205f552e3 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Fri, 15 Aug 2025 10:53:02 +0200 Subject: [PATCH 2/7] fix some Qt5 incompatibilities --- astigstatsdlg.cpp | 5 +++++ mainwindow.cpp | 15 ++++++++++++++- profileplot.cpp | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/astigstatsdlg.cpp b/astigstatsdlg.cpp index 300f7488..9992af56 100644 --- a/astigstatsdlg.cpp +++ b/astigstatsdlg.cpp @@ -742,7 +742,12 @@ void astigStatsDlg::on_distribution_clicked() runningAvgNSB->setValue(runningAvgN); runningAvgNSB->setMaximum(1000); runningAvgNSB->setSingleStep(10); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) connect(runningAvgNSB, &QSpinBox::valueChanged, this, &astigStatsDlg::runningNChanged); +#else + // QSpinBox::valueChanged is overloaded in Qt5 + connect(runningAvgNSB, QOverload::of(&QSpinBox::valueChanged), this, &astigStatsDlg::runningNChanged); +#endif QCheckBox *polarCB = new QCheckBox("Polar"); connect(polarCB, &QAbstractButton::clicked, this, &astigStatsDlg::usePolar); diff --git a/mainwindow.cpp b/mainwindow.cpp index e06cd810..8e9499f4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1797,9 +1797,17 @@ void MainWindow::on_actionCreate_Movie_of_wavefronts_triggered() qDebug() << "plain text"<< text; QApplication::setOverrideCursor(Qt::WaitCursor); QProcess *proc = new QProcess; - QObject::connect(proc, &QProcess::finished, proc, &QObject::deleteLater); + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QObject::connect(proc, &QProcess::finished, proc, &QObject::deleteLater); + connect(proc, &QProcess::finished, [=](int exitCode, QProcess::ExitStatus exitStatus){ qDebug() << "what" << exitStatus << "code" << exitCode; }); +#else + //QProcess::finished is overloaded in Qt5 + QObject::connect(proc, QOverload::of(&QProcess::finished), proc, &QObject::deleteLater); connect(proc, QOverload::of(&QProcess::finished), [=](int exitCode, QProcess::ExitStatus exitStatus){ qDebug() << "what" << exitStatus << "code" << exitCode; }); +#endif + // ensure we kill ffmpeg if the dialog is closed connect(dialog, &QDialog::finished, dialog, [=](int) { @@ -1824,7 +1832,12 @@ void MainWindow::on_actionCreate_Movie_of_wavefronts_triggered() }); QEventLoop loop; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QObject::connect(proc, &QProcess::finished, &loop, &QEventLoop::quit); +#else + //QProcess::finished is overloaded in Qt5 + QObject::connect(proc, QOverload::of(&QProcess::finished), &loop, &QEventLoop::quit); +#endif loop.exec(); qDebug() << "done" ; diff --git a/profileplot.cpp b/profileplot.cpp index 9b82fcfb..a7a90538 100644 --- a/profileplot.cpp +++ b/profileplot.cpp @@ -112,7 +112,13 @@ ProfilePlot::ProfilePlot(QWidget *parent , ContourTools *tools): if (!m_showSlopeError) slopeLimitSB->hide(); showSlopeError->setChecked(m_showSlopeError); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) connect(slopeLimitSB, &QDoubleSpinBox::valueChanged, this, &ProfilePlot::slopeLimit); +#else + // QDoubleSpinBox::valueChanged is overloaded in Qt5 + connect(slopeLimitSB, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ProfilePlot::slopeLimit); +#endif + // connect(showSlopeError,&QAbstractButton::clicked, this, &ProfilePlot::showSlope); connect(showPercentCorrection,&QAbstractButton::clicked, this, &ProfilePlot::showCorrection); l1->addWidget(showPercentCorrection); From b243f33ebcf6eac837b3a4ad13230b7bf964a8d0 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Fri, 15 Aug 2025 11:20:08 +0200 Subject: [PATCH 3/7] remove some Q_SIGNALS and Q_SLOTS --- contourplot.h | 7 ++----- graphmodifier.h | 4 ++-- pixelstats.h | 2 +- surfacegraph.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/contourplot.h b/contourplot.h index 56409e76..5ce87170 100644 --- a/contourplot.h +++ b/contourplot.h @@ -88,11 +88,8 @@ class ContourPlot: public QwtPlot void newContourRange(double); void sigPointSelected(QPointF ); -public Q_SLOTS: - void selected(QPointF pos); - - -public Q_SLOTS: +public slots: + void selected(QPointF pos); void showContour( bool on ); void showSpectrogram(bool on ); void setAlpha( int ); diff --git a/graphmodifier.h b/graphmodifier.h index 0b294866..256d87fb 100644 --- a/graphmodifier.h +++ b/graphmodifier.h @@ -67,7 +67,7 @@ class GraphModifier : public QObject void setReverseValueAxis(int enabled); void setReflection(bool enabled); -public Q_SLOTS: +public slots: void changeRange(int range); void changeStyle(int style); void changeSelectionMode(int selectionMode); @@ -79,7 +79,7 @@ public Q_SLOTS: void setAxisTitleFixed(bool enabled); void zoomToSelectedBar(); -Q_SIGNALS: +signals: void shadowQualityChanged(int quality); void backgroundEnabledChanged(bool enabled); void gridEnabledChanged(bool enabled); diff --git a/pixelstats.h b/pixelstats.h index cea5a505..eacd0406 100644 --- a/pixelstats.h +++ b/pixelstats.h @@ -52,7 +52,7 @@ class CanvasPicker: public QObject virtual bool eventFilter( QObject *, QEvent * ); virtual bool event( QEvent * ); -Q_SIGNALS: +signals: void markerMoved(); private: diff --git a/surfacegraph.h b/surfacegraph.h index a4213ea0..75afc442 100644 --- a/surfacegraph.h +++ b/surfacegraph.h @@ -88,7 +88,7 @@ class SurfaceGraph : public QObject void setLegend(QLabel * legend) {m_legend = legend;} QImage render(int width, int height); QSize Size(); -public Q_SLOTS: +public slots: void changeTheme(int theme); void setColorMap(int ndx); void yOffsetChanged(int val); From 3d43349ef79f17f297c2cca40db08e13766001c7 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Fri, 15 Aug 2025 14:02:02 +0200 Subject: [PATCH 4/7] manually update some connects --- IgramArea.h | 4 ++-- contourplot.cpp | 3 +-- dftarea.h | 2 +- igramarea.cpp | 22 ++++++++-------------- mainwindow.cpp | 10 ++++------ oglview.cpp | 2 +- simulationsview.cpp | 2 +- standastigwizard.cpp | 2 +- surfaceanalysistools.cpp | 2 +- surfaceanalysistools.h | 2 +- surfacemanager.cpp | 18 +++++++++--------- surfacemanager.h | 8 ++++---- zernikesmoothingdlg.cpp | 2 +- 13 files changed, 35 insertions(+), 44 deletions(-) diff --git a/IgramArea.h b/IgramArea.h index 6fa49701..663d7ee6 100644 --- a/IgramArea.h +++ b/IgramArea.h @@ -169,7 +169,8 @@ public slots: void zoomIn(); void zoomOut(); void igramOutlineParmsChanged(const outlineParms &parms); - void increase( int i = 1); + void increaseValue(int); + void increase(); void decrease(); void zoomFull(); void toggleHideOutline(); @@ -201,7 +202,6 @@ public slots: QDockWidget *dock; void drawBoundary(); void resizeImage(); - void createActions(); void zoom(int del, QPointF zoompt); bool modified; bool scribbling; diff --git a/contourplot.cpp b/contourplot.cpp index 0016741d..02d5adda 100644 --- a/contourplot.cpp +++ b/contourplot.cpp @@ -492,8 +492,7 @@ ContourPlot::ContourPlot( QWidget *parent, ContourTools *tools, bool minimal ): tracker_ = new MyZoomer(this->canvas(), this); - connect(picker_, SIGNAL(selected(const QPointF&)), - SLOT(selected(const QPointF&))); + connect(picker_, QOverload::of(&QwtPlotPicker::selected), this, &ContourPlot::selected); QSettings settings; m_colorMapNdx = settings.value("colorMapType",0).toInt(); diff --git a/dftarea.h b/dftarea.h index cd2c3370..1e4db207 100644 --- a/dftarea.h +++ b/dftarea.h @@ -87,7 +87,7 @@ public slots: void setDftSizeVal(int); void selectDFTTab(); void updateFilterSize(int); - void newWavefront(cv::Mat, CircleOutline, CircleOutline, QString, + void newWavefront(cv::Mat, CircleOutline, CircleOutline, const QString &, QVector >); void dftReady(QImage); void statusBarUpdate(QString, int); diff --git a/igramarea.cpp b/igramarea.cpp index 1ee60f6f..983fd965 100644 --- a/igramarea.cpp +++ b/igramarea.cpp @@ -128,7 +128,7 @@ IgramArea::IgramArea(QWidget *parent, void *mw) shortcut = new QShortcut(QKeySequence(Qt::Key_Minus), this); QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::decrease); shortcut = new QShortcut(QKeySequence(Qt::Key_Plus), this); - QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(increase())); + QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::increase); shortcut = new QShortcut(QKeySequence("f"), this); QObject::connect(shortcut, &QShortcut::activated, this, &IgramArea::zoomFull); shortcut = new QShortcut(QKeySequence("h"), this); @@ -843,7 +843,7 @@ void IgramArea::findOutline(){ m_searching_outside = false; shiftoutline(QPointF(set.value("autoOutlineXOffset", 0).toInt(), -set.value("autoOutlineYOffset", 0).toInt())); - increase(set.value("autoOutlineRadOffset", 0).toInt()); + increaseValue(set.value("autoOutlineRadOffset", 0).toInt()); // ui->holeX->setValue(set.value("autoholeXOffset", 0).toInt()); @@ -1249,7 +1249,7 @@ void IgramArea::increaseRegion(int n, double scale){ } -void IgramArea::increase(int i) { +void IgramArea::increaseValue(int i) { if (m_current_boundry == OutSideOutline) { m_outside.enlarge(i); @@ -1266,6 +1266,11 @@ void IgramArea::increase(int i) { } drawBoundary(); } + +void IgramArea::increase() { + increaseValue(1); +} + void IgramArea::decrease(){ if (m_current_boundry == OutSideOutline) { @@ -1986,17 +1991,6 @@ void IgramArea::saveRegions(){ set.setValue("lastRegions", text); } -void IgramArea::createActions() -{ - - fitToWindowAct = new QAction(tr("&Fit to Window"), this); - fitToWindowAct->setEnabled(false); - fitToWindowAct->setCheckable(true); - fitToWindowAct->setShortcut(tr("Ctrl+f")); - connect(fitToWindowAct, SIGNAL(triggered()), this, SLOT(fitToWindow())); - -} - void IgramArea::crop() { // add current bounds to crop history. diff --git a/mainwindow.cpp b/mainwindow.cpp index 8e9499f4..aaf897b1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -152,7 +152,6 @@ MainWindow::MainWindow(QWidget *parent) : connect(m_ogl, &OGLView::fullScreen, this, &MainWindow::zoomOgl); connect(userMapDlg, &userColorMapDlg::colorMapChanged, m_contourView->getPlot(), &ContourPlot::ContourMapColorChanged); - //connect(userMapDlg, SIGNAL(colorMapChanged(int)),m_ogl->m_gl, SLOT(colorMapChanged(int))); review = new reviewWindow(this); review->s1->addWidget(m_ogl); @@ -179,11 +178,10 @@ MainWindow::MainWindow(QWidget *parent) : m_surfaceManager = SurfaceManager::get_instance(this,m_surfTools, m_profilePlot, m_contourView, m_ogl->m_surface, metrics); connect(m_contourView, &contourView::showAllContours, m_surfaceManager, &SurfaceManager::showAllContours); - connect(m_dftArea, SIGNAL(newWavefront(cv::Mat,CircleOutline,CircleOutline,QString, QVector >)), - m_surfaceManager, SLOT(createSurfaceFromPhaseMap(cv::Mat,CircleOutline,CircleOutline,QString, QVector >))); + connect(m_dftArea, &DFTArea::newWavefront, m_surfaceManager, &SurfaceManager::createSurfaceFromPhaseMap); connect(m_surfaceManager, &SurfaceManager::diameterChanged,this,&MainWindow::diameterChanged); connect(m_surfaceManager, &SurfaceManager::showTab, ui->tabWidget, &QTabWidget::setCurrentIndex); - connect(m_surfTools, SIGNAL(updateSelected()), m_surfaceManager, SLOT(backGroundUpdate())); + connect(m_surfTools, SIGNAL(updateSelected()), m_surfaceManager, SLOT(backGroundUpdate())); //TODO test as SurfaceManager::backGroundUpdate is a private slot ui->tabWidget->addTab(review, "Results"); ui->tabWidget->addTab(SimulationsView::getInstance(ui->tabWidget), "Star Test, PSF, MTF"); @@ -1376,7 +1374,7 @@ void MainWindow::startJitter(){ else m_igramArea->m_center = saved; - m_igramArea->increase(rad); + m_igramArea->increaseValue(rad); m_igramArea->shiftoutline(QPointF(x,y)); qApp->processEvents(); QObject().thread()->msleep(1000); @@ -1392,7 +1390,7 @@ void MainWindow::startJitter(){ wavefront *wf = m_surfaceManager->m_wavefronts[m_surfaceManager->m_currentNdx]; wf->name = QString("x:_%1_Y:_%2_radius:_%3").arg(x).arg(y).arg(rad); dlg->status(wf->name); - m_surfTools->nameChanged(m_surfaceManager->m_currentNdx, wf->name); + m_surfTools->nameChangedN(m_surfaceManager->m_currentNdx, wf->name); qApp->processEvents(); QObject().thread()->msleep(500); } diff --git a/oglview.cpp b/oglview.cpp index 8e5f3ca8..e9462781 100644 --- a/oglview.cpp +++ b/oglview.cpp @@ -220,7 +220,7 @@ void OGLView::showSelected() // show all selected wavefronts as 3D plots scrollArea->setAutoFillBackground(true); QPushButton *savePb = new QPushButton("Save as Image",w); SurfaceManager *sm = SurfaceManager::get_instance(); - connect(savePb, SIGNAL(pressed()), sm, SLOT(saveAllContours())); + connect(savePb, SIGNAL(pressed()), sm, SLOT(saveAllContours())); //TODO test current code as saveAllContours is a private slot layout->addWidget(savePb,0,Qt::AlignHCenter); layout->addWidget(scrollArea); w->setLayout(layout); diff --git a/simulationsview.cpp b/simulationsview.cpp index ad0777b5..bc409495 100644 --- a/simulationsview.cpp +++ b/simulationsview.cpp @@ -166,7 +166,7 @@ void SimulationsView::showContextMenu(QPoint pos) QPoint globalPos = mapToGlobal(pos); // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("Save as image", this, SLOT(saveImage())); + myMenu.addAction("Save as image", this, SLOT(saveImage())); //TODO test current code as signature of saveImage(QString fileName) doesn't match QAction::triggered(bool checked = false) // Show context menu at handling position myMenu.exec(globalPos); diff --git a/standastigwizard.cpp b/standastigwizard.cpp index b610a5c2..b2018da1 100644 --- a/standastigwizard.cpp +++ b/standastigwizard.cpp @@ -36,7 +36,7 @@ standAstigWizard::standAstigWizard(SurfaceManager *sm, QWidget *parent, Qt::Wind setPage(Page_makeAverages, new makeAverages); setPage(Page_define_input, new define_input); define_input * di = dynamic_cast(page(Page_define_input)); - connect(di, SIGNAL(computeStandAstig(define_input *,QList)), sm, SLOT(computeStandAstig(define_input *,QList))); + connect(di, &define_input::computeStandAstig, sm, &SurfaceManager::computeStandAstig); setStartId(Page_Intro); //setOption(HaveHelpButton, true); diff --git a/surfaceanalysistools.cpp b/surfaceanalysistools.cpp index da741b54..3c368aa9 100644 --- a/surfaceanalysistools.cpp +++ b/surfaceanalysistools.cpp @@ -243,7 +243,7 @@ void surfaceAnalysisTools::on_SelectNonePB_clicked() { ui->wavefrontList->selectionModel()->reset(); } -void surfaceAnalysisTools::nameChanged(int ndx, const QString &newname){ +void surfaceAnalysisTools::nameChangedN(int ndx, const QString &newname){ ui->wavefrontList->item(ndx)->setText(newname); } diff --git a/surfaceanalysistools.h b/surfaceanalysistools.h index 75692884..7b5df724 100644 --- a/surfaceanalysistools.h +++ b/surfaceanalysistools.h @@ -48,7 +48,7 @@ class surfaceAnalysisTools : public QDockWidget double m_defocus; double m_defocusInmm; void setBlurText(const QString &txt); - void nameChanged(int, const QString&); + void nameChangedN(int, const QString&); void select(int item); signals: diff --git a/surfacemanager.cpp b/surfacemanager.cpp index 13d9307f..05a2bf5c 100644 --- a/surfacemanager.cpp +++ b/surfacemanager.cpp @@ -518,16 +518,16 @@ SurfaceManager::SurfaceManager(QObject *parent, surfaceAnalysisTools *tools, connect(m_surfaceTools, &surfaceAnalysisTools::surfaceSmoothGBEnabled, this, &SurfaceManager::surfaceSmoothGBEnabled); connect(m_surfaceTools, &surfaceAnalysisTools::surfaceSmoothGBValue, this, &SurfaceManager::surfaceSmoothGBValue); connect(m_surfaceTools, &surfaceAnalysisTools::wftNameChanged, this, &SurfaceManager::wftNameChanged); - connect(this, SIGNAL(nameChanged(QString, QString)), m_surfaceTools, SLOT(nameChanged(QString,QString))); + connect(this, &SurfaceManager::nameChanged, m_surfaceTools, &surfaceAnalysisTools::nameChanged); connect(m_metrics, &metricsDisplay::recomputeZerns, this, &SurfaceManager::computeZerns); connect(m_surfaceTools, &surfaceAnalysisTools::defocusChanged, this, &SurfaceManager::defocusChanged); connect(m_surfaceTools, &surfaceAnalysisTools::defocusSetup, this, &SurfaceManager::defocusSetup); connect(this, &SurfaceManager::currentNdxChanged, m_surfaceTools, &surfaceAnalysisTools::currentNdxChanged); connect(this, &SurfaceManager::deleteWavefront, m_surfaceTools, &surfaceAnalysisTools::deleteWaveFront); - connect(m_surfaceTools, SIGNAL(deleteTheseWaveFronts(QList)), this, SLOT(deleteWaveFronts(QList))); - connect(m_surfaceTools, SIGNAL(average(QList)),this, SLOT(average(QList))); - connect(m_surfaceTools, SIGNAL(doxform(QList)),this, SLOT(transfrom(QList))); - connect(m_surfaceTools, SIGNAL(invert(QList)),this,SLOT(invert(QList))); + connect(m_surfaceTools, &surfaceAnalysisTools::deleteTheseWaveFronts, this, &SurfaceManager::deleteWaveFronts); + connect(m_surfaceTools, SIGNAL(average(QList)),this, SLOT(average(QList))); //TODO rename average + connect(m_surfaceTools, &surfaceAnalysisTools::doxform,this, &SurfaceManager::transfrom); + connect(m_surfaceTools, &surfaceAnalysisTools::invert,this,&SurfaceManager::invert); connect(m_surfaceTools, &surfaceAnalysisTools::filterWavefronts,this,&SurfaceManager::filter); connect(this, &SurfaceManager::enableControls,m_surfaceTools, &surfaceAnalysisTools::enableControls); connect(mirrorDlg::get_Instance(),&mirrorDlg::recomputeZerns, this, &SurfaceManager::computeZerns); @@ -1809,7 +1809,7 @@ void SurfaceManager::subtractWavefronts(){ void SurfaceManager::transfrom(const QList &list){ RotationDlg dlg(list); - connect(&dlg, SIGNAL(rotateTheseSig(double, QList)), this, SLOT(rotateThese( double, QList))); + connect(&dlg, &RotationDlg::rotateTheseSig, this, &SurfaceManager::rotateThese); dlg.exec(); } @@ -3057,10 +3057,10 @@ void SurfaceManager::transform(){ return; } TransformWaveFrontDlg dlg; - connect(&dlg, SIGNAL(flipLR()), this, SLOT(flipHorizontal())); - connect(&dlg, SIGNAL(flipV()),this, SLOT(flipVertical())); + connect(&dlg, &TransformWaveFrontDlg::flipLR, this, QOverload<>::of(&SurfaceManager::flipHorizontal)); + connect(&dlg, &TransformWaveFrontDlg::flipV, this, QOverload<>::of(&SurfaceManager::flipVertical)); connect(&dlg, &TransformWaveFrontDlg::resizeW, this, &SurfaceManager::resizeW); - connect(&dlg, SIGNAL(changeWavelength(double)), this, SLOT(changeWavelength(double))); + connect(&dlg, &TransformWaveFrontDlg::changeWavelength, this, QOverload::of(&SurfaceManager::changeWavelength)); dlg.exec(); } diff --git a/surfacemanager.h b/surfacemanager.h index d4cf1cc7..7ca00955 100644 --- a/surfacemanager.h +++ b/surfacemanager.h @@ -136,6 +136,9 @@ class SurfaceManager : public QObject explicit SurfaceManager(QObject *parent=0, surfaceAnalysisTools *tools = 0, ProfilePlot *profilePlot =0, contourView *contourView = 0, SurfaceGraph *glPlot = 0, metricsDisplay *mets = 0); textres Phase2(QList list, QList inputs, int avgNdx, int Width, QPrinter &printer); + void changeWavelength(wavefront *wf, double wavelength); + void flipHorizontal(wavefront *wf); + void flipVertical(wavefront *wf); signals: void currentNdxChanged(int); @@ -145,7 +148,7 @@ class SurfaceManager : public QObject void progress(int); void diameterChanged(double); void rocChanged(double); - void nameChanged(QString, QString); + void nameChanged(const QString &, const QString &); void showTab(int); void enableControls(bool); private slots: @@ -167,9 +170,6 @@ private slots: void averageComplete(wavefront *wft); void outputLambdaChanged(double val); void resize(wavefront * wf, int size); - void changeWavelength(wavefront *wf, double wavelength); - void flipHorizontal(wavefront *wf); - void flipVertical(wavefront *wf); void resizeW(int size); void changeWavelength(double wavelength); void flipHorizontal(); diff --git a/zernikesmoothingdlg.cpp b/zernikesmoothingdlg.cpp index 47f06c16..d1def28b 100644 --- a/zernikesmoothingdlg.cpp +++ b/zernikesmoothingdlg.cpp @@ -145,7 +145,7 @@ void ZernikeSmoothingDlg::on_createWaveFront_clicked() if (ui->showResidual->isChecked()){ m_sm->subtract(&m_wf, m_sm->m_wavefronts.back(), false); m_sm->m_wavefronts.back()->name = QString("Residual_%1").arg(m_noOfTerms); - m_sm->m_surfaceTools->nameChanged(m_sm->m_currentNdx, m_sm->m_wavefronts.back()->name); + m_sm->m_surfaceTools->nameChangedN(m_sm->m_currentNdx, m_sm->m_wavefronts.back()->name); m_sm->m_surfaceTools->currentNdxChanged(m_sm->m_currentNdx); m_sm->previous(); m_sm->m_surfaceTools->currentNdxChanged(m_sm->m_currentNdx); From aa65ee09baa70d149dd99952c547fa2620c59ed6 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Sat, 16 Aug 2025 11:04:22 +0200 Subject: [PATCH 5/7] manually update somme connects (require slot public or renaming) --- contourview.h | 3 ++- mainwindow.cpp | 10 +++++----- oglview.cpp | 2 +- surfacemanager.cpp | 4 ++-- surfacemanager.h | 8 ++++---- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/contourview.h b/contourview.h index 42a6a51f..980d97e4 100644 --- a/contourview.h +++ b/contourview.h @@ -54,8 +54,9 @@ private slots: void on_showRuler_clicked(bool checked); - void updateRuler(); void on_LinkProfileCB_clicked(bool checked); +public slots: + void updateRuler(); private: Ui::contourView *ui; diff --git a/mainwindow.cpp b/mainwindow.cpp index aaf897b1..fc0ebdcd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -181,7 +181,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(m_dftArea, &DFTArea::newWavefront, m_surfaceManager, &SurfaceManager::createSurfaceFromPhaseMap); connect(m_surfaceManager, &SurfaceManager::diameterChanged,this,&MainWindow::diameterChanged); connect(m_surfaceManager, &SurfaceManager::showTab, ui->tabWidget, &QTabWidget::setCurrentIndex); - connect(m_surfTools, SIGNAL(updateSelected()), m_surfaceManager, SLOT(backGroundUpdate())); //TODO test as SurfaceManager::backGroundUpdate is a private slot + connect(m_surfTools, &surfaceAnalysisTools::updateSelected, m_surfaceManager, &SurfaceManager::backGroundUpdate); ui->tabWidget->addTab(review, "Results"); ui->tabWidget->addTab(SimulationsView::getInstance(ui->tabWidget), "Star Test, PSF, MTF"); @@ -215,7 +215,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(m_dftTools,&DFTTools::doDFT,m_dftArea,&DFTArea::doDFT); settingsDlg = Settings2::getInstance(); connect(settingsDlg->m_igram, &settingsIGram::igramLinesChanged, m_igramArea, &IgramArea::igramOutlineParmsChanged); - connect(settingsDlg->m_general, SIGNAL(updateContourPlot()),m_contourView, SLOT(updateRuler())); + connect(settingsDlg->m_general, &SettingsGeneral2::updateContourPlot, m_contourView, &contourView::updateRuler); QSettings settings; spdlog::get("logger")->trace("qSettings stored at: {}", settings.fileName().toStdString()); @@ -1288,8 +1288,8 @@ void MainWindow::batchProcess(QStringList fileList){ QToolTip::showText( batchIgramWizard::saveZerns->mapToGlobal(QPoint(0,20)),batchIgramWizard::saveZerns->toolTip()); } - connect(batchWiz->introPage->astigPlot, SIGNAL(waveSeleted(QString)), m_surfaceManager, SLOT(wavefrontDClicked(QString))); - connect(batchWiz->introPage->m_rmsPlot, SIGNAL(waveSeleted(QString)), m_surfaceManager, SLOT(wavefrontDClicked(QString))); + connect(batchWiz->introPage->astigPlot, &astigScatterPlot::waveSeleted, m_surfaceManager, &SurfaceManager::wavefrontDClicked); + connect(batchWiz->introPage->m_rmsPlot, &rmsPlot::waveSeleted, m_surfaceManager, &SurfaceManager::wavefrontDClicked); progBar->reset(); batchIgramWizard::goPb->setEnabled(true); batchIgramWizard::addFiles->setEnabled(true); @@ -2102,7 +2102,7 @@ void MainWindow::on_actionastig_in_polar_triggered() samples << sample; } astigPolargraph * graph = new astigPolargraph(samples); - connect(graph, SIGNAL(waveSeleted(QString)), m_surfaceManager, SLOT(wavefrontDClicked(QString))); + connect(graph, &astigPolargraph::waveSeleted, m_surfaceManager, &SurfaceManager::wavefrontDClicked); QScreen *screen = QGuiApplication::primaryScreen(); QSizeF physicalSize = screen->availableSize(); graph->resize(physicalSize.width()/2,physicalSize.height()/2); diff --git a/oglview.cpp b/oglview.cpp index e9462781..00db28c7 100644 --- a/oglview.cpp +++ b/oglview.cpp @@ -220,7 +220,7 @@ void OGLView::showSelected() // show all selected wavefronts as 3D plots scrollArea->setAutoFillBackground(true); QPushButton *savePb = new QPushButton("Save as Image",w); SurfaceManager *sm = SurfaceManager::get_instance(); - connect(savePb, SIGNAL(pressed()), sm, SLOT(saveAllContours())); //TODO test current code as saveAllContours is a private slot + connect(savePb, &QPushButton::pressed, sm, &SurfaceManager::saveAllContours); layout->addWidget(savePb,0,Qt::AlignHCenter); layout->addWidget(scrollArea); w->setLayout(layout); diff --git a/surfacemanager.cpp b/surfacemanager.cpp index 05a2bf5c..e3ceff69 100644 --- a/surfacemanager.cpp +++ b/surfacemanager.cpp @@ -525,7 +525,7 @@ SurfaceManager::SurfaceManager(QObject *parent, surfaceAnalysisTools *tools, connect(this, &SurfaceManager::currentNdxChanged, m_surfaceTools, &surfaceAnalysisTools::currentNdxChanged); connect(this, &SurfaceManager::deleteWavefront, m_surfaceTools, &surfaceAnalysisTools::deleteWaveFront); connect(m_surfaceTools, &surfaceAnalysisTools::deleteTheseWaveFronts, this, &SurfaceManager::deleteWaveFronts); - connect(m_surfaceTools, SIGNAL(average(QList)),this, SLOT(average(QList))); //TODO rename average + connect(m_surfaceTools, &surfaceAnalysisTools::average,this, &SurfaceManager::averageWavefrontIndices); connect(m_surfaceTools, &surfaceAnalysisTools::doxform,this, &SurfaceManager::transfrom); connect(m_surfaceTools, &surfaceAnalysisTools::invert,this,&SurfaceManager::invert); connect(m_surfaceTools, &surfaceAnalysisTools::filterWavefronts,this,&SurfaceManager::filter); @@ -1467,7 +1467,7 @@ void SurfaceManager::backGroundUpdate(){ -void SurfaceManager::average(QList list){ +void SurfaceManager::averageWavefrontIndices(QList list){ if (list.length() < 2){ QMessageBox::warning(0,"Warning", "Select at least two wave fronts to be averaged."); return; diff --git a/surfacemanager.h b/surfacemanager.h index 7ca00955..dd0a0a1f 100644 --- a/surfacemanager.h +++ b/surfacemanager.h @@ -153,19 +153,16 @@ class SurfaceManager : public QObject void enableControls(bool); private slots: void waveFrontClickedSlot(int ndx); - void wavefrontDClicked(const QString & name); void centerMaskValue(int val); void outsideMaskValue(int val); void surfaceSmoothGBEnabled(bool b); void surfaceSmoothGBValue(double value); void computeZerns(); void surfaceGenFinished(); - void backGroundUpdate(); void deleteWaveFronts(QList list); - void average(QList list); + void averageWavefrontIndices(QList list); void transfrom(const QList &list); void filter(); - void saveAllContours(); void enableTools(); void averageComplete(wavefront *wft); void outputLambdaChanged(double val); @@ -191,6 +188,9 @@ public slots: void memoryLow(); void defocusChanged(); void tiltAnalysis(); + void saveAllContours(); + void backGroundUpdate(); + void wavefrontDClicked(const QString & name); }; From bf8afa2b23d507b5a0de7a35e8f8fb1eee4338f7 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Mon, 18 Aug 2025 19:00:22 +0200 Subject: [PATCH 6/7] update the 2 connectTo methods --- contourtools.cpp | 21 ++++++++++----------- contourtools.h | 5 ++++- dfttools.cpp | 8 +++++--- dfttools.h | 4 +++- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/contourtools.cpp b/contourtools.cpp index 802c2424..20e0cabc 100644 --- a/contourtools.cpp +++ b/contourtools.cpp @@ -17,6 +17,7 @@ ****************************************************************************/ #include "contourtools.h" #include "ui_contourtools.h" +#include "contourplot.h" #include #include #include @@ -65,17 +66,15 @@ ContourTools::~ContourTools() delete ui; } -void ContourTools::connectTo(QWidget *view){ - connect(this, SIGNAL(ContourMapColorChanged(int)), view, SLOT(ContourMapColorChanged(int))); - connect(this, SIGNAL(contourZeroOffsetChanged(const QString &)), - view, SLOT(contourZeroOffsetChanged(const QString &))); - connect(this, SIGNAL(contourColorRangeChanged(const QString &)), - view, SLOT(contourColorRangeChanged(const QString &))); - connect(view, SIGNAL(setMinMaxValues(double,double)),this, SLOT(setMinMaxValues(double,double))); - connect(this, SIGNAL(contourWaveRangeChanged(double)),view, SLOT(contourWaveRangeChanged(double))); - connect(view, SIGNAL(setWaveRange(double)),this, SLOT(setWaveRange(double))); - connect(this, SIGNAL(lineColorChanged(QColor)), view, SLOT(on_line_color_changed(QColor))); - connect(this, SIGNAL(newDisplayErrorRange(double,double)), view, SLOT(newDisplayErrorRange(double,double))); +void ContourTools::connectTo(ContourPlot *view){ + connect(this, &ContourTools::ContourMapColorChanged, view, &ContourPlot::ContourMapColorChanged); + connect(this, &ContourTools::contourZeroOffsetChanged, view, &ContourPlot::contourZeroOffsetChanged); + connect(this, &ContourTools::contourColorRangeChanged, view, &ContourPlot::contourColorRangeChanged); + connect(view, &ContourPlot::setMinMaxValues,this, &ContourTools::setMinMaxValues); + connect(this, &ContourTools::contourWaveRangeChanged, view, &ContourPlot::contourWaveRangeChanged); + connect(view, &ContourPlot::setWaveRange,this, &ContourTools::setWaveRange); + connect(this, &ContourTools::lineColorChanged, view, &ContourPlot::on_line_color_changed); + connect(this, &ContourTools::newDisplayErrorRange, view, &ContourPlot::newDisplayErrorRange); enablTools(false); } diff --git a/contourtools.h b/contourtools.h index c070e04a..73676664 100644 --- a/contourtools.h +++ b/contourtools.h @@ -20,6 +20,9 @@ #include #include + +class ContourPlot; + namespace Ui { class ContourTools; } @@ -31,7 +34,7 @@ class ContourTools : public QDockWidget public: explicit ContourTools(QWidget *parent = 0); ~ContourTools(); - void connectTo(QWidget *view); + void connectTo(ContourPlot *view); double m_interval; void enablTools(bool b); double m_min; diff --git a/dfttools.cpp b/dfttools.cpp index d9c19684..4dc607a6 100644 --- a/dfttools.cpp +++ b/dfttools.cpp @@ -20,6 +20,8 @@ #include "vortex.h" #include #include "settings2.h" +#include "dftarea.h" + DFTTools::DFTTools(QWidget *parent) : QDockWidget(parent), ui(new Ui::DFTTools) @@ -30,9 +32,9 @@ DFTTools::DFTTools(QWidget *parent) : ui->dftSizeSB->setValue(set.value("DFTSize", 640).toInt()); } -void DFTTools::connectTo(QWidget *view){ - connect(view, SIGNAL(updateFilterSize(int)),this, SLOT(setCenterFilterValue(int))); - connect(ui->gammaSl, SIGNAL(valueChanged(int)), view, SLOT(gamma(int))); +void DFTTools::connectTo(DFTArea *view){ + connect(view, &DFTArea::updateFilterSize, this, &DFTTools::setCenterFilterValue); + connect(ui->gammaSl, &QSlider::valueChanged, view, &DFTArea::gamma); } DFTTools::~DFTTools() { diff --git a/dfttools.h b/dfttools.h index 6bf9c853..8ff895c1 100644 --- a/dfttools.h +++ b/dfttools.h @@ -20,6 +20,8 @@ #include +class DFTArea; + namespace Ui { class DFTTools; } @@ -30,7 +32,7 @@ class DFTTools : public QDockWidget public: explicit DFTTools(QWidget *parent = 0); - void connectTo(QWidget *view); + void connectTo(DFTArea *view); bool wasPressed; void imageSize(const QString &txt); void setDFTSize(int val); From fffd251e3f5a060bb0166bfcf62da4c67847e9f0 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Wed, 20 Aug 2025 18:20:28 +0200 Subject: [PATCH 7/7] remove last old style SLOT --- DFTFringe.pro | 1 - DFTFringe_Dale.pro | 1 - DFTFringe_QT5.pro | 1 - simulationsview.cpp | 21 ++++++++++++--------- simulationsview.h | 3 ++- wavefrontstats.h | 44 -------------------------------------------- 6 files changed, 14 insertions(+), 57 deletions(-) delete mode 100644 wavefrontstats.h diff --git a/DFTFringe.pro b/DFTFringe.pro index 30c1b95d..2cb9728a 100644 --- a/DFTFringe.pro +++ b/DFTFringe.pro @@ -385,7 +385,6 @@ HEADERS += bezier/bezier.h \ wavefrontaveragefilterdlg.h \ wavefrontfilterdlg.h \ wavefrontloader.h \ - wavefrontstats.h \ wftexaminer.h \ wftstats.h \ zernikedlg.h \ diff --git a/DFTFringe_Dale.pro b/DFTFringe_Dale.pro index a500a54d..b46a68ed 100644 --- a/DFTFringe_Dale.pro +++ b/DFTFringe_Dale.pro @@ -189,7 +189,6 @@ HEADERS += mainwindow.h \ metricsdisplay.h \ reviewwindow.h \ vortex.h \ - wavefrontstats.h \ wavefrontloader.h \ rotationdlg.h \ wftstats.h \ diff --git a/DFTFringe_QT5.pro b/DFTFringe_QT5.pro index aeb2c10f..2ec59040 100644 --- a/DFTFringe_QT5.pro +++ b/DFTFringe_QT5.pro @@ -384,7 +384,6 @@ HEADERS += bezier/bezier.h \ wavefrontaveragefilterdlg.h \ wavefrontfilterdlg.h \ wavefrontloader.h \ - wavefrontstats.h \ wftexaminer.h \ wftstats.h \ zernikedlg.h \ diff --git a/simulationsview.cpp b/simulationsview.cpp index bc409495..6228ba40 100644 --- a/simulationsview.cpp +++ b/simulationsview.cpp @@ -145,12 +145,17 @@ void SimulationsView::setSurface(wavefront *wf){ if (!isHidden()) on_MakePB_clicked(); } -void SimulationsView::saveImage(QString fileName){ + +void SimulationsView::saveImage(){ QSettings settings; QString path = settings.value("lastPath","").toString(); - if (fileName == "") - fileName = QFileDialog::getSaveFileName(0, + QString fileName = QFileDialog::getSaveFileName(0, "File name for image to be saved", path); + + saveImageNamed(fileName); +} + +void SimulationsView::saveImageNamed(QString fileName){ if (!fileName.endsWith(".jpg")) fileName = fileName + ".jpg"; QImage svImage = QImage(size(),QImage::Format_ARGB32 ); @@ -159,14 +164,12 @@ void SimulationsView::saveImage(QString fileName){ svImage.save(fileName); } -void SimulationsView::showContextMenu(QPoint pos) -{ - -// Handle global position +void SimulationsView::showContextMenu(QPoint pos){ + // Handle global position QPoint globalPos = mapToGlobal(pos); // Create menu and insert some actions QMenu myMenu; - myMenu.addAction("Save as image", this, SLOT(saveImage())); //TODO test current code as signature of saveImage(QString fileName) doesn't match QAction::triggered(bool checked = false) + myMenu.addAction("Save as image", this, &SimulationsView::saveImage); // connects to QAction::triggered(bool checked = false) // Show context menu at handling position myMenu.exec(globalPos); @@ -509,7 +512,7 @@ void SimulationsView::on_film_clicked() QApplication::processEvents(); QString name = QString("/frame%1").arg(cnt++, 3 ,10, QLatin1Char('0')); - saveImage(filmDir+name); + saveImageNamed(filmDir+name); } } int offset = 0; diff --git a/simulationsview.h b/simulationsview.h index 8daaba0a..c069b66a 100644 --- a/simulationsview.h +++ b/simulationsview.h @@ -60,6 +60,7 @@ class SimulationsView : public QWidget double dX; // pupil sample size based on mirror size in wave front. double dF; // psf sample size; + void saveImageNamed(QString fn); void mtf(const cv::Mat &magPsf, const QString &txt, QColor color); void initMTFPlot(); @@ -78,7 +79,7 @@ private slots: void showContextMenu(QPoint pos); - void saveImage(QString fn = ""); + void saveImage(); void on_film_clicked(); diff --git a/wavefrontstats.h b/wavefrontstats.h deleted file mode 100644 index d8bd5bc9..00000000 --- a/wavefrontstats.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** -** -** Copyright 2016 Dale Eason -** This file is part of DFTFringe -** is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation version 3 of the License - -** DFTFringe is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with DFTFringe. If not, see . - -****************************************************************************/ -#ifndef WAVEFRONTSTATS_H -#define WAVEFRONTSTATS_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -class WaveFrontStats : public QwtPlot -{ -public: - WaveFrontStats(QWidget *parent); - void setData(QPolygonF wftPoints, QPolygonF avgPoints); - void saveImage(); - void savePdf(); - void setup(); -private: - QwtPlotCurve *curve1; - QwtPlotCurve* curve2; - QPolygonF wftPoints; - QwtPlot * m_plot; -}; - -#endif // WAVEFRONTSTATS_H