diff options
author | Liang Qi <liang.qi@qt.io> | 2016-08-02 10:32:32 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-08-02 13:14:05 +0200 |
commit | 8fa108de666e815053c6e586f1efabc592ae20a5 (patch) | |
tree | 6e9418f38cd884a7a204d7c0e1ec10c871c37346 /src/serialport/qserialport.cpp | |
parent | b2dcacddabb5bcfbc031a0681a0e90996092a506 (diff) | |
parent | 10967b1443720116744ecfc42fe442681d149c5a (diff) | |
download | qtserialport-8fa108de666e815053c6e586f1efabc592ae20a5.tar.gz |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
.qmake.conf
src/serialport/qserialport.cpp
Change-Id: I858fec6e426f5fd867b7eda7b1db69a2d447b357
Diffstat (limited to 'src/serialport/qserialport.cpp')
-rw-r--r-- | src/serialport/qserialport.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 4f3fd04..02a9422 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -109,7 +109,6 @@ QSerialPortPrivate::QSerialPortPrivate() , startAsyncWriteTimer(0) , originalEventMask(0) , triggeredEventMask(0) - , actualBytesToWrite(0) #elif defined(Q_OS_UNIX) , descriptor(-1) , readNotifier(0) @@ -515,10 +514,6 @@ void QSerialPort::setPort(const QSerialPortInfo &serialPortInfo) \li Removes the prefix "\\\\.\\" or "//./" from the system location and returns the remainder of the string. \row - \li Windows CE - \li Removes the suffix ":" from the system location - and returns the remainder of the string. - \row \li Unix, BSD \li Removes the prefix "/dev/" from the system location and returns the remainder of the string. @@ -568,15 +563,6 @@ bool QSerialPort::open(OpenMode mode) if (!d->open(mode)) return false; - if (!d->setBaudRate() - || !d->setDataBits(d->dataBits) - || !d->setParity(d->parity) - || !d->setStopBits(d->stopBits) - || !d->setFlowControl(d->flowControl)) { - d->close(); - return false; - } - QIODevice::open(mode); return true; } @@ -659,9 +645,9 @@ bool QSerialPort::settingsRestoredOnClose() const after that the opening of the port succeeds. \warning Setting the AllDirections flag is supported on all platforms. - Windows and Windows CE support only this mode. + Windows supports only this mode. - \warning Returns equal baud rate in any direction on Windows, Windows CE. + \warning Returns equal baud rate in any direction on Windows. The default value is Baud9600, i.e. 9600 bits per second. */ @@ -1261,11 +1247,8 @@ qint64 QSerialPort::bytesAvailable() const */ qint64 QSerialPort::bytesToWrite() const { - qint64 bytes = QIODevice::bytesToWrite(); -#ifdef Q_OS_WIN32 - bytes += d_func()->actualBytesToWrite; -#endif - return bytes; + Q_D(const QSerialPort); + return QIODevice::bytesToWrite() + d->writeBuffer.size(); } /*! |