From 9322b1a8c7b1975897482075bfc19c47e647e9c1 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 5 May 2021 15:15:50 +0100 Subject: [PATCH] Avoid MainWindow methods being called via the event loop during construction --- map65/mainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/map65/mainwindow.cpp b/map65/mainwindow.cpp index 53eec2950..99cf40e8b 100644 --- a/map65/mainwindow.cpp +++ b/map65/mainwindow.cpp @@ -115,7 +115,6 @@ MainWindow::MainWindow(QWidget *parent) : QTimer *guiTimer = new QTimer(this); connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate())); - guiTimer->start(100); //Don't change the 100 ms! m_auto=false; m_waterfallAvg = 1; @@ -291,7 +290,11 @@ MainWindow::MainWindow(QWidget *parent) : if(ui->actionCuteSDR->isChecked()) on_actionCuteSDR_triggered(); if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered(); if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); - // End of MainWindow constructor + + // only start the guiUpdate timer after this constructor has finished + QTimer::singleShot (0, [=] { + guiTimer->start(100); //Don't change the 100 ms! + }); } //--------------------------------------------------- MainWindow destructor