| 1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef INTERACTIVEWORK_H
- #define INTERACTIVEWORK_H
- #include <QThread>
- #include <QMutex>
- #include <QMutexLocker>
- #include <QThreadPool>
- #include "InteractiveTask.h"
- #include "template_singleton.h"
- class InteractiveWork : public QThread
- {
- SINGLETON_DEFINE(InteractiveWork)
- Q_OBJECT
- private:
- explicit InteractiveWork(QObject *parent = nullptr);
- ~InteractiveWork();
- public:
- void appendTask(InteractiveTask *task);
- protected:
- void run();
- signals:
- void signal_completed(InteractiveTask *task);
- void signal_failstart(InteractiveTask *task);
- private:
- bool m_bThread;
- QMutex m_mutex;
- QList<InteractiveTask *> m_listTask;
- };
- #endif // INTERACTIVEWORK_H
|