summaryrefslogtreecommitdiffstats
path: root/async/autotests/testkjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'async/autotests/testkjob.cpp')
-rw-r--r--async/autotests/testkjob.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/async/autotests/testkjob.cpp b/async/autotests/testkjob.cpp
new file mode 100644
index 0000000..b86f913
--- /dev/null
+++ b/async/autotests/testkjob.cpp
@@ -0,0 +1,28 @@
1#include "testkjob.h"
2
3TestKJob::TestKJob(int result)
4 : mResult(result)
5{
6 connect(&mTimer, &QTimer::timeout,
7 this, &TestKJob::onTimeout);
8 mTimer.setSingleShot(true);
9 mTimer.setInterval(200);
10}
11
12TestKJob::~TestKJob()
13{}
14
15void TestKJob::start()
16{
17 mTimer.start();
18}
19
20int TestKJob::result()
21{
22 return mResult;
23}
24
25void TestKJob::onTimeout()
26{
27 emitResult();
28} \ No newline at end of file