diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-09-27 18:50:11 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2017-10-05 06:44:18 +0000 |
commit | 2098f98997b82358ede6994f2e1d0a27ade30b1e (patch) | |
tree | b47a71337d4b7f859570360fa622b15d72c07b8a /examples/serialport/master/dialog.h | |
parent | ad8c10bd7a91e3bdda1a9df92ee307318780cdf4 (diff) | |
download | qtserialport-2098f98997b82358ede6994f2e1d0a27ade30b1e.tar.gz |
Revamp the Non-Blocking Master Example
* Use the 'm_' prefixes for all class members.
* 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: Ibdc607653d8727b88d4e041d0a9eb0a96e3289d7
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/serialport/master/dialog.h')
-rw-r--r-- | examples/serialport/master/dialog.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/examples/serialport/master/dialog.h b/examples/serialport/master/dialog.h index 0bc1241..2fb2e8e 100644 --- a/examples/serialport/master/dialog.h +++ b/examples/serialport/master/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 &error); private: - int transactionCount; - QLabel *serialPortLabel; - QComboBox *serialPortComboBox; - QLabel *waitResponseLabel; - QSpinBox *waitResponseSpinBox; - QLabel *requestLabel; - QLineEdit *requestLineEdit; - QLabel *trafficLabel; - QLabel *statusLabel; - QPushButton *runButton; + int m_transactionCount = 0; + QLabel *m_serialPortLabel = nullptr; + QComboBox *m_serialPortComboBox = nullptr; + QLabel *m_waitResponseLabel = nullptr; + QSpinBox *m_waitResponseSpinBox = nullptr; + QLabel *m_requestLabel = nullptr; + QLineEdit *m_requestLineEdit = nullptr; + QLabel *m_trafficLabel = nullptr; + QLabel *m_statusLabel = nullptr; + QPushButton *m_runButton = nullptr; - QSerialPort serial; - QByteArray response; - QTimer timer; + QSerialPort m_serial; + QByteArray m_response; + QTimer m_timer; }; #endif // DIALOG_H |