UpdatePTUDevCtrl/mainwindow.h

58 lines
1.3 KiB
C
Raw Normal View History

2023-07-31 16:55:36 +02:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QStatusBar>
2023-07-31 16:55:36 +02:00
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
#include "worker.h"
class hwinf;
2023-07-31 16:55:36 +02:00
class MainWindow : public QMainWindow {
Q_OBJECT
protected:
void customEvent(QEvent *event) override;
2023-07-31 16:55:36 +02:00
public:
MainWindow(hwinf *hw, Worker *worker, QWidget *parent = nullptr);
2023-07-31 16:55:36 +02:00
~MainWindow();
static const int START_PROGRESS_LOOP = -1;
static const int STOP_PROGRESS_LOOP = -2;
int progressValue() const { return m_progressValue; }
hwinf *getPlugin() { return m_hw; }
hwinf const *getPlugin() const { return m_hw; }
public slots:
void onAppendText(QString, QString suffix = "");
void onReplaceLast(QStringList, QString suffix = "");
2023-08-07 13:53:48 +02:00
void onReplaceLast(QString, QString suffix = "");
void onShowErrorMessage(QString, QString);
void onStopStartTimer();
void onRestartExitTimer();
void onEnableExit();
void onDisableExit();
2023-07-31 16:55:36 +02:00
private slots:
void onQuit();
2023-07-31 16:55:36 +02:00
private:
void scrollDownTextEdit();
2023-07-31 16:55:36 +02:00
Ui::MainWindow *ui;
hwinf *m_hw;
2023-07-31 16:55:36 +02:00
Worker *m_worker;
int m_width;
QTimer *m_startTimer;
QTimer *m_exitTimer;
bool m_progressRunning;
int m_progressValue;
2023-07-31 16:55:36 +02:00
};
#endif // MAINWINDOW_H