Obsolete Members for QSerialPort | Qt Serial Port 5.5

- Qt 5.5
- Qt Serial Port
- C++ Classes
- QSerialPort
- Qt 5.5.1 Reference Documentation

# 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

- `(obsolete)` dataErrorPolicy : DataErrorPolicy
- `(obsolete)` settingsRestoredOnClose : bool

## Member Type Documentation

### enum QSerialPort::DataErrorPolicy

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

Constant | Value | Description
--- | --- | ---
`QSerialPort::SkipPolicy` | `0` | Skips the bad character.
`QSerialPort::PassZeroPolicy` | `1` | Replaces bad character with zero.
`QSerialPort::IgnorePolicy` | `2` | Ignores the error for a bad character.
`QSerialPort::StopReceivingPolicy` | `3` | Stops data reception on error.
`QSerialPort::UnknownPolicy` | `-1` | Unknown policy.

See also QSerialPort::dataErrorPolicy.

## Property Documentation

### dataErrorPolicy : DataErrorPolicy

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:

DataErrorPolicy | dataErrorPolicy() const
bool | setDataErrorPolicy(DataErrorPolicy policy = IgnorePolicy)

Notifier signal:

void | dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy)

### settingsRestoredOnClose : bool

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)