From d518352631874449878661333345d9ecf97be090 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Tue, 27 Oct 2026 19:43:21 +0100 Subject: [PATCH 1/5] remove unused parameters --- mainwindow.cpp | 10 +++++----- oglview.cpp | 4 ++-- surfacegraph.cpp | 2 +- surfacegraph.h | 2 +- surfacemanager.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 9c33bcc3..ccab4b74 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1049,7 +1049,7 @@ void MainWindow::on_actionSave_screen_triggered() QImage image( this->size(), QImage::Format_ARGB32 ); - QImage SurfaceImage = m_ogl->m_surface->render(1000,1000); + QImage SurfaceImage = m_ogl->m_surface->render(); QPainter painter( &image ); @@ -1399,7 +1399,7 @@ void MainWindow::batchProcess(QStringList fileList){ //::reviewFileName = videoFileName; } QImage img = QImage(width,height,QImage::Format_RGB32); - QImage d3 = m_ogl->m_surface->render(1000,1000).scaled(width/2,height/2); + QImage d3 = m_ogl->m_surface->render().scaled(width/2,height/2); QImage dft = m_dftArea->grab().toImage().scaled(width/2, height/2); QImage igram = m_igramArea->grab().toImage().scaled(width/2, height/2); QImage contour = m_contourView->getPlot()->grab().toImage().scaled(width/2, height/2); @@ -1857,7 +1857,7 @@ void MainWindow::on_actionCreate_Movie_of_wavefronts_triggered() QSettings set; QString lastPath = set.value("lastPath",".").toString(); //int memThreshold = set.value("lowMemoryThreshold",300).toInt(); - QImage img = m_ogl->m_surface->render(1000,1000); + QImage img = m_ogl->m_surface->render(); int width = img.width(); int height = img.height(); @@ -1895,7 +1895,7 @@ void MainWindow::on_actionCreate_Movie_of_wavefronts_triggered() delete wf; QApplication::processEvents(); if (dowavefront){ - QImage img = m_ogl->m_surface->render(1000,1000); + QImage img = m_ogl->m_surface->render(); QPainter painter(&img); painter.setPen(Qt::yellow); painter.setBrush(Qt::yellow); @@ -2680,7 +2680,7 @@ void MainWindow::runLiveAnalysisLoop() { } // 6. RENDER SURFACE - img = m_ogl->m_surface->render(1000, 1000); + img = m_ogl->m_surface->render(); m_ogl->m_liveLabel->setPixmap(QPixmap::fromImage(img)); // Update UI Status Bar QString statusRightText; diff --git a/oglview.cpp b/oglview.cpp index 17d70618..e353bfa6 100644 --- a/oglview.cpp +++ b/oglview.cpp @@ -167,7 +167,7 @@ void OGLView::saveImage(){ if (fName.isEmpty()) return; - QImage img = m_surface->render(1000,1000); + QImage img = m_surface->render(); img.save(fName); } #include @@ -198,7 +198,7 @@ void OGLView::showSelected() // show all selected wavefronts as 3D plots { wavefront * wf = m_wavefronts[list[i]]; m_surface->setSurface(wf); - QImage glImage = m_surface->render(width,width); + QImage glImage = m_surface->render(); QPainter p2(&glImage); p2.setFont(serifFont); p2.setPen(QPen(QColor(Qt::white))); diff --git a/surfacegraph.cpp b/surfacegraph.cpp index 4edf513d..3dd5c4ad 100644 --- a/surfacegraph.cpp +++ b/surfacegraph.cpp @@ -482,7 +482,7 @@ void SurfaceGraph::setGreenToRedGradient() QSize SurfaceGraph::Size(){ return m_graph->size(); } -QImage SurfaceGraph::render(int width, int height){ +QImage SurfaceGraph::render(){ // Render directly at the widget's current display size without resizing the live view return m_graph->renderToImage(0, m_graph->size()); } diff --git a/surfacegraph.h b/surfacegraph.h index 75afc442..16b2e921 100644 --- a/surfacegraph.h +++ b/surfacegraph.h @@ -86,7 +86,7 @@ class SurfaceGraph : public QObject void setSurface(wavefront *wf); void setGraphColors(); void setLegend(QLabel * legend) {m_legend = legend;} - QImage render(int width, int height); + QImage render(); QSize Size(); public slots: void changeTheme(int theme); diff --git a/surfacemanager.cpp b/surfacemanager.cpp index cdc99084..864d16ad 100644 --- a/surfacemanager.cpp +++ b/surfacemanager.cpp @@ -3224,7 +3224,7 @@ void SurfaceManager::report(){ if (dlg.ui->show3D->isChecked()){ // assemble the surface metrics from the OG 3D view and the color map legend // put into the OGLW window that will provide the titles and placement. - QImage SurfaceImage =m_SurfaceGraph->render(1000, 1000); + QImage SurfaceImage =m_SurfaceGraph->render(); const QPixmap pm = m_SurfaceGraph->m_legend->pixmap(Qt::ReturnByValue); QSize lsize = pm.size(); QImage legend(lsize, QImage::Format_ARGB32); From 9e2c2a8d5d712396b80a421f97dc8bf6055c4584 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Tue, 27 Oct 2026 19:52:49 +0100 Subject: [PATCH 2/5] fix -Wreorder warning --- wavefront.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wavefront.cpp b/wavefront.cpp index 9d125a39..948fdf95 100644 --- a/wavefront.cpp +++ b/wavefront.cpp @@ -18,7 +18,17 @@ #include "wavefront.h" wavefront::wavefront(): - zernEnablesApplied(),gaussian_diameter(0.),gbEnabled(false),gbValue(20.),wasSmoothed(false),useSANull(true),GBSmoothingValue(0.),m_origin(WavefrontOrigin::Unknown),m_manuallyInverted(false),dirtyZerns(true),regions_have_been_expanded(false) + zernEnablesApplied(), + gaussian_diameter(0.), + GBSmoothingValue(0.), + gbValue(20.), + m_origin(WavefrontOrigin::Unknown), + dirtyZerns(true), + regions_have_been_expanded(false), + gbEnabled(false), + wasSmoothed(false), + useSANull(true), + m_manuallyInverted(false) { } From a9ae6bf391bdba07d324693c9cc5351ee4df8b40 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Tue, 27 Oct 2026 19:54:15 +0100 Subject: [PATCH 3/5] remove unused variable --- igramarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/igramarea.cpp b/igramarea.cpp index 5e90e6e6..ec695dfb 100644 --- a/igramarea.cpp +++ b/igramarea.cpp @@ -2443,7 +2443,7 @@ void IgramArea::writeOutlines(QString fileName){ qWarning("Couldn't save .OLN (outline) file."); return; } - QFileInfo info(saveFile); + saveFile.write(jsondoc.toJson()); saveFile.close(); From 6ba4e401d40cfe3605bf534b652362e143d8bdcf Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Tue, 27 Oct 2026 19:57:26 +0100 Subject: [PATCH 4/5] move declaration from slot to private member --- mainwindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mainwindow.h b/mainwindow.h index 32628247..dce75ccb 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -134,7 +134,6 @@ private slots: void on_actionPreferences_triggered(); void mainTabChanged(int); - QString getCurrentHotKeyHelp() const ; void on_actionMirror_triggered(); void on_saveOutline_clicked(); @@ -305,6 +304,7 @@ private slots: void setCurrentFile(const QString &fileName); void updateRecentFileActions(); QString strippedName(const QString &fullFileName); + QString getCurrentHotKeyHelp() const; QMenu* m_view_menu; QTimer *m_liveViewRMSTimer = NULL; void createActions(); From 587e66b2853756071e8467e64195a7431b4b68f6 Mon Sep 17 00:00:00 2001 From: Julien Staub Date: Tue, 27 Oct 2026 19:59:31 +0100 Subject: [PATCH 5/5] pass QString as const reference because it's a large type --- IgramArea.h | 2 +- igramarea.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/IgramArea.h b/IgramArea.h index 911b82ea..35f27e0e 100644 --- a/IgramArea.h +++ b/IgramArea.h @@ -112,7 +112,7 @@ class IgramArea : public QWidget IgramArea(QWidget *parent = 0, void *mwp = 0 ); void *m_mw; - bool openImage(QImage img, bool showBoundary, QString = "stream"); + bool openImage(QImage img, bool showBoundary, const QString &fileName = "stream"); bool openImage(const QString &fileName, bool showBoundary = true); bool saveImage(const QString &fileName, const char *fileFormat); void setPenColor(const QColor &newColor); diff --git a/igramarea.cpp b/igramarea.cpp index ec695dfb..e63ba770 100644 --- a/igramarea.cpp +++ b/igramarea.cpp @@ -977,7 +977,7 @@ void IgramArea::adjustCenterandRegions(){ } } } -bool IgramArea::openImage(QImage loadedImage, bool showBoundary, QString fileName){ +bool IgramArea::openImage(QImage loadedImage, bool showBoundary, const QString &fileName){ if (Settings2::getInstance()->m_igram->m_removeDistortion){ cv::Mat raw = cv::imread(fileName.toStdString().c_str()); @@ -2640,4 +2640,3 @@ void IgramArea::setZoomMode(zoomMode mode){ zoomFull(); } -