42 lines
775 B
C++
42 lines
775 B
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QTimer>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class MainWindow; }
|
|
QT_END_NAMESPACE
|
|
|
|
#include "worker.h"
|
|
|
|
class MainWindow : public QMainWindow {
|
|
Q_OBJECT
|
|
|
|
protected:
|
|
void customEvent(QEvent *event) override;
|
|
|
|
public:
|
|
MainWindow(Worker *worker, QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
public slots:
|
|
void onAppendText(QString, QString);
|
|
void onShowErrorMessage(QString, QString);
|
|
void onStopStartTimer();
|
|
void onRestartExitTimer();
|
|
void onEnableExit();
|
|
void onDisableExit();
|
|
|
|
private slots:
|
|
void onQuit();
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
Worker *m_worker;
|
|
int m_width;
|
|
QTimer *m_startTimer;
|
|
QTimer *m_exitTimer;
|
|
};
|
|
#endif // MAINWINDOW_H
|