From 13e89f96b86de7034af888617434f812a5303bdf Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 14 Aug 2014 22:35:03 +0400 Subject: Fix handling of writing at using of waitForReadyRead() The method waitForReadyRead() shall call of the write sequence since the signals from the startAsyncWriteTimer will not be handled inside of waitForReadyRead() without event-loop. Tested on Windows 8 with the on-board and USB serial ports, using Qt5. Task-number: QTBUG-40793 Change-Id: I7806f16a4df30c4ec1643d8f696ad5761decd30a Reviewed-by: Patrick Noffke Reviewed-by: Sergey Belyashov --- src/serialport/qserialport_win.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index 19f35b7..ecbf464 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -327,6 +327,9 @@ bool QSerialPortPrivate::waitForReadyRead(int msecs) QElapsedTimer stopWatch; stopWatch.start(); + if (!writeStarted && !startAsyncWrite()) + return false; + const qint64 initialReadBufferSize = readBuffer.size(); qint64 currentReadBufferSize = initialReadBufferSize; -- cgit v1.2.1