QSerialPort in QThread run bytesAvailable is zero
问题 Have a simple Qt app. Gui thread, creates Dev thread it creates (in its run()) Read thread. Dev and Read threads are my classes inherited from QThread. The Read thread should read data from COM port continuously. An approximate view of Read run is following. read::run() { sp2->clear(); while (DO_EXEC) { if (DO_WRITE) { // write data to port } usleep(500); ba = sp2->bytesAvailable(); if (ba > 0) { int a = sp2->read(&BUF[BUF_END], ba); // process data emit sgnl(sendeddata); } } } To start it I