開發平台(Platform): (Ex: Win10, Linux, ...)
win10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
vs2015
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
qt5.7
問題(Question):
void PC_info::setupTimer(){
timer = new QTimer(0);
connect(timer,SIGNAL(timeout(),this,SLOT(OnScan()),Qt::DirectConnection));
timer->start(1000);
//thread = new QThread(this);
//timer ->moveToThread(thread);
//thread->start();
}
大家好 目前在寫定時掃電腦資訊的程式
OnScan是去掃HWinfo關於電腦的資訊
但是進到OnScan的時候 會讓整個ui出現頓感
後來使用QThread來寫的時候 頓感解決
但....會有機率性的讓ui整個凍結
不知道是不是thread的用法錯誤了呢