mainwindow.h Example File
terminal/mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSerialPort>
class QLabel;
namespace Ui {
class MainWindow;
}
class Console;
class SettingsDialog;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void openSerialPort();
void closeSerialPort();
void about();
void writeData(const QByteArray &data);
void readData();
void handleError(QSerialPort::SerialPortError error);
private:
void initActionsConnections();
private:
void showStatusMessage(const QString &message);
Ui::MainWindow *m_ui = nullptr;
QLabel *m_status = nullptr;
Console *m_console = nullptr;
SettingsDialog *m_settings = nullptr;
QSerialPort *m_serial = nullptr;
};
#endif // MAINWINDOW_H