diff options
Diffstat (limited to 'printerclient.h')
| -rw-r--r-- | printerclient.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/printerclient.h b/printerclient.h new file mode 100644 index 0000000..5f4f2a3 --- /dev/null +++ b/printerclient.h @@ -0,0 +1,29 @@ +#pragma once + +#include <QObject> + +#include <QSerialPort> + +class QSerialPort; + +class PrinterClient : public QObject +{ + Q_OBJECT + +public: + explicit PrinterClient(QObject *parent = nullptr); + ~PrinterClient() override = default; + +signals: + void newData(const QString output); + +public slots: + void sendCommand(const QString command); + +private slots: + void onReadyRead(); + void onErrorOccured(QSerialPort::SerialPortError error); + +private: + QSerialPort* m_serialPort { nullptr }; +}; |
