From b986c98f9c0aa40bdc8b258a5191f3e74cf9cd2f Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Thu, 26 Mar 2015 15:33:32 +0300 Subject: [PATCH] Optimized priority --- main.cpp | 3 --- mainwindow.cpp | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 2209392..2ed518c 100644 --- a/main.cpp +++ b/main.cpp @@ -12,9 +12,6 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationName("RepRaptor"); QCoreApplication::setApplicationVersion(REPRAPTOR_VERSION); - //Set the priority, so the OS would not mess up serial communication - QThread::currentThread()->setPriority(QThread::HighestPriority); - MainWindow w; w.show(); diff --git a/mainwindow.cpp b/mainwindow.cpp index fbad59d..b7e74ed 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -129,6 +129,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(parserWorker, &Parser::receivedSDDone, this, &MainWindow::receivedSDDone); connect(parserWorker, &Parser::receivedSDUpdate, this, &MainWindow::updateSDStatus); parserThread->start(); + parserThread->setPriority(QThread::HighestPriority); //Sender thread signal-slots and init senderWorker->moveToThread(senderThread);