diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-29 20:12:13 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-29 20:12:13 +0200 |
commit | a0ecf10023f208f65b752aa5b348590aa29a29c1 (patch) | |
tree | c89164bacd3af2304aabdea1dac80c588bff8060 | |
parent | 1f43a753f756f5888857b91766046a5a56fea97b (diff) | |
parent | e9566e39dcec4a575d2d44f103562e60e760574f (diff) | |
download | qtserialport-a0ecf10023f208f65b752aa5b348590aa29a29c1.tar.gz |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
.qmake.conf
Change-Id: Ia9e9e9c87403195ac07233c4bb001509ecd36bfe
-rw-r--r-- | dist/changes-5.5.0 | 33 | ||||
-rw-r--r-- | src/serialport/qserialport.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport.h | 4 | ||||
-rw-r--r-- | src/serialport/qserialport_p.h | 1 | ||||
-rw-r--r-- | src/serialport/qserialport_win.cpp | 55 |
5 files changed, 40 insertions, 55 deletions
diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 new file mode 100644 index 0000000..9100a5f --- /dev/null +++ b/dist/changes-5.5.0 @@ -0,0 +1,33 @@ +QtSerialPort 5.5 introduces a few new features and improvements as well as +bugfixes over the 5.4.x series. For more details, refer to the online +documentation included in this distribution. The documentation is also available +online: + + https://doc.qt.io/ + +The QtSerialPort version 5.5 series is binary compatible with the 5.4.x series. +Applications compiled for 5.4 will continue to run with 5.5. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Library * +**************************************************************************** + + - Now the version for Qt 4 always will be in the separate "qt4-dev" branch. + + - QSerialPort: + * [QTBUG-34946] The streaming does not stop anymore when the window is + resizing or moving. + * Added new lock directories for the *nix-specific platforms. + * The method QSP::clearError() now clears the error string. + * [QTBUG-45338] It is now possible to open the serial port on OS X when + the App Sandbox is used. + * [QTBUG-46066] The QT_DISABLE_DEPRECATED_BEFORE=QT_VERSION macro does + not lead to compilation failure now. diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index e9c6922..9d5aa40 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -556,9 +556,9 @@ void QSerialPort::close() return; } - QIODevice::close(); d->close(); d->isBreakEnabled = false; + QIODevice::close(); } /*! diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h index cbf489d..7531e47 100644 --- a/src/serialport/qserialport.h +++ b/src/serialport/qserialport.h @@ -259,13 +259,13 @@ Q_SIGNALS: void parityChanged(QSerialPort::Parity parity); void stopBitsChanged(QSerialPort::StopBits stopBits); void flowControlChanged(QSerialPort::FlowControl flowControl); -#if QT_DEPRECATED_SINCE(5, 2) +#if QT_DEPRECATED_SINCE(5, 5) QT_DEPRECATED void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy); #endif void dataTerminalReadyChanged(bool set); void requestToSendChanged(bool set); void error(QSerialPort::SerialPortError serialPortError); -#if QT_DEPRECATED_SINCE(5, 3) +#if QT_DEPRECATED_SINCE(5, 5) QT_DEPRECATED void settingsRestoredOnCloseChanged(bool restore); #endif void breakEnabledChanged(bool set); diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h index ad8d9d0..7da2204 100644 --- a/src/serialport/qserialport_p.h +++ b/src/serialport/qserialport_p.h @@ -202,7 +202,6 @@ public: bool initialize(); bool updateDcb(); bool updateCommTimeouts(); - qint64 overlappedResult(OVERLAPPED *overlapped); void handleLineStatusErrors(); OVERLAPPED *waitForNotified(int msecs); diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index b3d5c9d..e6e6924 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -284,14 +284,7 @@ bool QSerialPortPrivate::waitForReadyRead(int msecs) if (!overlapped) return false; - const qint64 bytesTransferred = overlappedResult(overlapped); - - if (overlapped == &communicationOverlapped) { - if (!completeAsyncCommunication(bytesTransferred)) - return false; - } else if (overlapped == &readCompletionOverlapped) { - if (!completeAsyncRead(bytesTransferred)) - return false; + if (overlapped == &readCompletionOverlapped) { const qint64 readBytesForOneReadOperation = qint64(buffer.size()) - currentReadBufferSize; if (readBytesForOneReadOperation == ReadChunkSize) { currentReadBufferSize = buffer.size(); @@ -301,11 +294,6 @@ bool QSerialPortPrivate::waitForReadyRead(int msecs) } else { return true; } - } else if (overlapped == &writeCompletionOverlapped) { - if (!completeAsyncWrite(bytesTransferred)) - return false; - } else { - return false; } } while (msecs == -1 || timeoutValue(msecs, stopWatch.elapsed()) > 0); @@ -329,20 +317,8 @@ bool QSerialPortPrivate::waitForBytesWritten(int msecs) if (!overlapped) return false; - const qint64 bytesTransferred = overlappedResult(overlapped); - - if (overlapped == &communicationOverlapped) { - if (!completeAsyncCommunication(bytesTransferred)) - return false; - } else if (overlapped == &readCompletionOverlapped) { - if (!completeAsyncRead(bytesTransferred)) - return false; - } else if (overlapped == &writeCompletionOverlapped) { - return completeAsyncWrite(bytesTransferred); - } else { - return false; - } - + if (overlapped == &writeCompletionOverlapped) + return true; } return false; @@ -735,8 +711,7 @@ inline bool QSerialPortPrivate::initialize() notifier = new QWinOverlappedIoNotifier(q); q->connect(notifier, SIGNAL(notified(quint32, quint32, OVERLAPPED*)), - q, SLOT(_q_notified(quint32, quint32, OVERLAPPED*)), - Qt::QueuedConnection); + q, SLOT(_q_notified(quint32, quint32, OVERLAPPED*))); notifier->setHandle(handle); notifier->setEnabled(true); @@ -768,28 +743,6 @@ bool QSerialPortPrivate::updateCommTimeouts() return true; } -qint64 QSerialPortPrivate::overlappedResult(OVERLAPPED *overlapped) -{ - Q_Q(QSerialPort); - - DWORD bytesTransferred = 0; - if (!::GetOverlappedResult(handle, overlapped, &bytesTransferred, FALSE)) { - const QSerialPort::SerialPortError error = decodeSystemError(); - if (error == QSerialPort::NoError) - return qint64(0); - if (error != QSerialPort::ResourceError) { - if (overlapped == &readCompletionOverlapped) - q->setError(QSerialPort::ReadError); - else if (overlapped == &writeCompletionOverlapped) - q->setError(QSerialPort::WriteError); - else - q->setError(error); - return qint64(-1); - } - } - return bytesTransferred; -} - QSerialPort::SerialPortError QSerialPortPrivate::decodeSystemError(int systemErrorCode) const { if (systemErrorCode == -1) |