Home > Mobile > Using inheritance QThread rewrite the run () method, signal inside groove QTcpsocket: : readyRead ()
Using inheritance QThread rewrite the run () method, signal inside groove QTcpsocket: : readyRead ()
Time:10-09
Because to BuKa interface, before creating MainWindow creates a wrapper QTcpsocket class (inherited QThread and inside signal channel), and then Start (). Connect to other server and send data there is no problem. But the other party to send data over the readyRead () did not trigger the corresponding slot function... At present only in the write () to send data after using the while (1) {waitForReadyRead (1); Read (); } card waiting for receiving data... Signal channel tried Qt: : DirectConnection and Qt: : QueuedConnection are no..
The use of this is wrong, please?
CodePudding user response:
Your readyRead () corresponding to the groove function is realized in QTcpsocket class, I was a thread inside, there is no problem