Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.8
-
None
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