summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-07-07 10:56:50 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-07-08 15:06:27 +0000
commiteb0dd8763c235b027bea91d5ec7fd82f06cacbab (patch)
treee1f41774c7dbdfb0dcabaa54000d5b95f2129fb2
parenta0ecf10023f208f65b752aa5b348590aa29a29c1 (diff)
downloadqtserialport-eb0dd8763c235b027bea91d5ec7fd82f06cacbab.tar.gz
Use the new Q_ENUM and Q_FLAG macro
Change-Id: I7ccfc1d374a6beca390f4f4ab27f7f4b5195ee08 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rw-r--r--src/serialport/qserialport.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index 7531e47..51ff296 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -65,9 +65,6 @@ class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice
#endif
Q_PROPERTY(bool breakEnabled READ isBreakEnabled WRITE setBreakEnabled NOTIFY breakEnabledChanged)
- Q_ENUMS(BaudRate DataBits Parity StopBits FlowControl DataErrorPolicy SerialPortError)
- Q_FLAGS(Directions PinoutSignals)
-
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
typedef void* Handle;
#else
@@ -81,6 +78,7 @@ public:
Output = 2,
AllDirections = Input | Output
};
+ Q_FLAG(Direction)
Q_DECLARE_FLAGS(Directions, Direction)
enum BaudRate {
@@ -94,6 +92,7 @@ public:
Baud115200 = 115200,
UnknownBaud = -1
};
+ Q_ENUM(BaudRate)
enum DataBits {
Data5 = 5,
@@ -102,6 +101,7 @@ public:
Data8 = 8,
UnknownDataBits = -1
};
+ Q_ENUM(DataBits)
enum Parity {
NoParity = 0,
@@ -111,6 +111,7 @@ public:
MarkParity = 5,
UnknownParity = -1
};
+ Q_ENUM(Parity)
enum StopBits {
OneStop = 1,
@@ -118,6 +119,7 @@ public:
TwoStop = 2,
UnknownStopBits = -1
};
+ Q_ENUM(StopBits)
enum FlowControl {
NoFlowControl,
@@ -125,6 +127,7 @@ public:
SoftwareControl,
UnknownFlowControl = -1
};
+ Q_ENUM(FlowControl)
enum PinoutSignal {
NoSignal = 0x00,
@@ -139,6 +142,7 @@ public:
SecondaryTransmittedDataSignal = 0x100,
SecondaryReceivedDataSignal = 0x200
};
+ Q_FLAG(PinoutSignal)
Q_DECLARE_FLAGS(PinoutSignals, PinoutSignal)
#if QT_DEPRECATED_SINCE(5, 2)
@@ -161,6 +165,7 @@ public:
StopReceivingPolicy,
UnknownPolicy = -1
};
+ Q_ENUM(DataErrorPolicy)
#endif
enum SerialPortError {
@@ -179,6 +184,7 @@ public:
TimeoutError,
NotOpenError
};
+ Q_ENUM(SerialPortError)
explicit QSerialPort(QObject *parent = Q_NULLPTR);
explicit QSerialPort(const QString &name, QObject *parent = Q_NULLPTR);