Obsolete Members for QSerialPort

The following members of class QSerialPort are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Types

(obsolete) enum DataErrorPolicy { SkipPolicy, PassZeroPolicy, IgnorePolicy, StopReceivingPolicy, UnknownPolicy }

Properties

Public Functions

(obsolete) QSerialPort::DataErrorPolicy dataErrorPolicy() const
(obsolete) bool setDataErrorPolicy(QSerialPort::DataErrorPolicy policy = IgnorePolicy)
(obsolete) void setSettingsRestoredOnClose(bool restore)
(obsolete) bool settingsRestoredOnClose() const

Signals

(obsolete) void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy)
(obsolete) void error(QSerialPort::SerialPortError error)
(obsolete) void settingsRestoredOnCloseChanged(bool restore)

Member Type Documentation

enum QSerialPort::DataErrorPolicy

This enum is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This enum describes the policies for the received symbols while parity errors were detected.

ConstantValueDescription
QSerialPort::SkipPolicy0Skips the bad character.
QSerialPort::PassZeroPolicy1Replaces bad character with zero.
QSerialPort::IgnorePolicy2Ignores the error for a bad character.
QSerialPort::StopReceivingPolicy3Stops data reception on error.
QSerialPort::UnknownPolicy-1Unknown policy.

See also QSerialPort::dataErrorPolicy.

Property Documentation

dataErrorPolicy : DataErrorPolicy

This property is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This property holds the error policy for how the process receives characters in the case where a parity error is detected.

If the setting is successful, returns true; otherwise returns false. The default policy set is IgnorePolicy.

Note: The serial port has to be open before trying to set this property; otherwise returns false and sets the NotOpenError error code. This is a bit unusual as opposed to the regular Qt property settings of a class. However, this is a special use case since the property is set through the interaction with the kernel and hardware. Hence, the two scenarios cannot be completely compared to each other.

Access functions:

QSerialPort::DataErrorPolicy dataErrorPolicy() const
bool setDataErrorPolicy(QSerialPort::DataErrorPolicy policy = IgnorePolicy)

Notifier signal:

void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy)

settingsRestoredOnClose : bool

This property is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This property holds the flag which specifies to restore the previous settings when closing the serial port.

If this flag is true, the settings will be restored; otherwise not. The default state of the QSerialPort class is to restore the settings.

Access functions:

bool settingsRestoredOnClose() const
void setSettingsRestoredOnClose(bool restore)

Notifier signal:

void settingsRestoredOnCloseChanged(bool restore)

Member Function Documentation

[signal] void QSerialPort::dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This signal is emitted after the error policy for how the process receives characters in case of parity error detection has been changed. The new error policy for how the process receives the character in case of parity error detection is passed as policy.

Note: Notifier signal for property dataErrorPolicy.

See also QSerialPort::dataErrorPolicy.

[signal] void QSerialPort::error(QSerialPort::SerialPortError error)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use errorOccurred() instead.

Note: Signal error is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

connect(serialPort, QOverload<QSerialPort::SerialPortError>::of(&QSerialPort::error),
    [=](QSerialPort::SerialPortError error){ /* ... */ });

[signal] void QSerialPort::settingsRestoredOnCloseChanged(bool restore)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This signal is emitted after the flag which specifies to restore the previous settings while closing the serial port has been changed. The new flag which specifies to restore the previous settings while closing the serial port is passed as restore.

Note: Notifier signal for property settingsRestoredOnClose.

See also QSerialPort::settingsRestoredOnClose.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.