summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/serialport/qserialport.cpp1
-rw-r--r--src/serialport/qserialport.h7
-rw-r--r--tests/auto/qserialport/tst_qserialport.cpp1
3 files changed, 4 insertions, 5 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index 040b7ef..6508940 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -568,6 +568,7 @@ void QSerialPort::close()
\property QSerialPort::settingsRestoredOnClose
\brief the flag which specifies to restore the previous settings when closing
the serial port.
+ \obsolete
If this flag is true, the settings will be restored; otherwise not.
The default state of the QSerialPort class is to restore the
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index fb77e81..6ca5af4 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -64,11 +64,11 @@ class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice
Q_PROPERTY(FlowControl flowControl READ flowControl WRITE setFlowControl NOTIFY flowControlChanged)
#if QT_DEPRECATED_SINCE(5, 2)
Q_PROPERTY(DataErrorPolicy dataErrorPolicy READ dataErrorPolicy WRITE setDataErrorPolicy NOTIFY dataErrorPolicyChanged)
+ Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged)
#endif
Q_PROPERTY(bool dataTerminalReady READ isDataTerminalReady WRITE setDataTerminalReady NOTIFY dataTerminalReadyChanged)
Q_PROPERTY(bool requestToSend READ isRequestToSend WRITE setRequestToSend NOTIFY requestToSendChanged)
Q_PROPERTY(SerialPortError error READ error RESET clearError NOTIFY error)
- Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged)
Q_ENUMS(BaudRate DataBits Parity StopBits FlowControl DataErrorPolicy SerialPortError)
Q_FLAGS(Directions PinoutSignals)
@@ -198,9 +198,6 @@ public:
bool open(OpenMode mode) Q_DECL_OVERRIDE;
void close() Q_DECL_OVERRIDE;
- void setSettingsRestoredOnClose(bool restore);
- bool settingsRestoredOnClose() const;
-
bool setBaudRate(qint32 baudRate, Directions directions = AllDirections);
qint32 baudRate(Directions directions = AllDirections) const;
@@ -231,6 +228,8 @@ public:
#if QT_DEPRECATED_SINCE(5, 2)
QT_DEPRECATED bool setDataErrorPolicy(DataErrorPolicy policy = IgnorePolicy);
QT_DEPRECATED DataErrorPolicy dataErrorPolicy() const;
+ void setSettingsRestoredOnClose(bool restore);
+ bool settingsRestoredOnClose() const;
#endif
SerialPortError error() const;
diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp
index 3e8c700..8c348bb 100644
--- a/tests/auto/qserialport/tst_qserialport.cpp
+++ b/tests/auto/qserialport/tst_qserialport.cpp
@@ -98,7 +98,6 @@ void tst_QSerialPort::defaultConstruct()
QVERIFY(!serialPort.errorString().isEmpty());
// properties
- QCOMPARE(serialPort.settingsRestoredOnClose(), true);
QCOMPARE(serialPort.baudRate(), qint32(0));
QCOMPARE(serialPort.baudRate(QSerialPort::Input), qint32(0));
QCOMPARE(serialPort.baudRate(QSerialPort::Output), qint32(0));