forked from PhysicsX/ExampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmytask.h
More file actions
31 lines (24 loc) · 643 Bytes
/
mytask.h
File metadata and controls
31 lines (24 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// mytask.h
#ifndef MYTASK_H
#define MYTASK_H
#include <QRunnable>
#include <QObject>
#include <QRunnable>
// Q_OBJECT missing in the original file generated by class wizard.
// because we set this class with base class QRunnable
// with no inheritance in the class wizard
// We do not have this. So, we cannot use signal/slot
// But we need them.
// Thus, we should use multiple inheritance: QObject inserted here
class MyTask : public QObject, public QRunnable
{
Q_OBJECT
public:
MyTask();
signals:
// notify to the main thread when we're done
void Result(int Number);
protected:
void run();
};
#endif // MYTASK_H