diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-09-27 18:41:25 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2017-10-05 06:44:06 +0000 |
commit | ad8c10bd7a91e3bdda1a9df92ee307318780cdf4 (patch) | |
tree | 145736a0988e41c25c55e79b7c3a1e6459409b5a /examples/serialport/slave/dialog.h | |
parent | 2cc09578947ee65dc502d5097d4553b696d91c9b (diff) | |
download | qtserialport-ad8c10bd7a91e3bdda1a9df92ee307318780cdf4.tar.gz |
Revamp the Non-Blocking Slave Example
* Use the 'm_' prefixes for all class members.
* Use the QOverload in signal/slot casting.
* Use more member class initializations.
* Remove QT_USE_NAMESPACE macro.
* Use from(to)Utf8 instead of from(to)Local8Bit.
Task-number: QTBUG-60652
Change-Id: I3f7f078aad6d86f56feb6a3dfa78bf158ee0ee63
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/serialport/slave/dialog.h')
-rw-r--r-- | examples/serialport/slave/dialog.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/examples/serialport/slave/dialog.h b/examples/serialport/slave/dialog.h index 0405cf8..13909c7 100644 --- a/examples/serialport/slave/dialog.h +++ b/examples/serialport/slave/dialog.h @@ -52,12 +52,9 @@ #define DIALOG_H #include <QDialog> +#include <QSerialPort> #include <QTimer> -#include <QtSerialPort/QSerialPort> - -QT_USE_NAMESPACE - QT_BEGIN_NAMESPACE class QLabel; @@ -85,20 +82,20 @@ private: void processError(const QString &s); private: - int transactionCount; - QLabel *serialPortLabel; - QComboBox *serialPortComboBox; - QLabel *waitRequestLabel; - QSpinBox *waitRequestSpinBox; - QLabel *responseLabel; - QLineEdit *responseLineEdit; - QLabel *trafficLabel; - QLabel *statusLabel; - QPushButton *runButton; + int m_transactionCount = 0; + QLabel *m_serialPortLabel = nullptr; + QComboBox *m_serialPortComboBox = nullptr; + QLabel *m_waitRequestLabel = nullptr; + QSpinBox *m_waitRequestSpinBox = nullptr; + QLabel *m_responseLabel = nullptr; + QLineEdit *m_responseLineEdit = nullptr; + QLabel *m_trafficLabel = nullptr; + QLabel *m_statusLabel = nullptr; + QPushButton *m_runButton = nullptr; - QSerialPort serial; - QByteArray request; - QTimer timer; + QSerialPort m_serial; + QByteArray m_request; + QTimer m_timer; }; #endif // DIALOG_H |