Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.12.8, 6.8.1
-
None
-
-
25
-
3f05f97de (dev), 746a2435c (6.9), faf12a1de (6.8), de3697f3e (tqtc/lts-6.5)
-
Foundation Sprint 121
Description
serial = new QSerialPort(this); connect(serial, &QIODevice::readyRead, this, &Dialog::readResponse); void Dialog::readResponse() { qDebug() << "ready"; QByteArray response = serial->readAll(); while (serial->waitForReadyRead(1000)) { response += serial->readAll(); } qDebug() << "done"; }
The document say that:
readyRead() is not emitted recursively; if you reenter the event loop or call waitForReadyRead() inside a slot connected to the readyRead() signal, the signal will not be reemitted
my understanding is `readResonpse` will only be called once when there were data can be read from serial port until `readResponse` returned, but from my observation, the "ready" message were printed multiple times, even the "done" message has never been printed