From 32a2d202fd671213682474aa33dbd691d2b05a64 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Wed, 8 Mar 2023 16:35:30 +0000 Subject: [PATCH] Set timer to be precise before calling start, otherwise it is ignored on Windows --- plugins/samplesource/testsource/testsourceworker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/samplesource/testsource/testsourceworker.cpp b/plugins/samplesource/testsource/testsourceworker.cpp index f06bcf89e..693d5293e 100644 --- a/plugins/samplesource/testsource/testsourceworker.cpp +++ b/plugins/samplesource/testsource/testsourceworker.cpp @@ -64,6 +64,7 @@ TestSourceWorker::TestSourceWorker(SampleSinkFifo* sampleFifo, QObject* parent) { connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); + m_timer.setTimerType(Qt::PreciseTimer); m_timer.start(50); } @@ -76,7 +77,6 @@ TestSourceWorker::~TestSourceWorker() void TestSourceWorker::startWork() { qDebug("TestSourceWorker::startWork"); - m_timer.setTimerType(Qt::PreciseTimer); m_running = true; }