summaryrefslogtreecommitdiffstats
path: root/async/autotests/testkjob.cpp
blob: b86f91399c73eac0326e3e1a66bdeaf30e45ce07 (plain)
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
#include "testkjob.h"

TestKJob::TestKJob(int result)
    : mResult(result)
{
    connect(&mTimer, &QTimer::timeout,
            this, &TestKJob::onTimeout);
    mTimer.setSingleShot(true);
    mTimer.setInterval(200);
}

TestKJob::~TestKJob()
{}

void TestKJob::start()
{
    mTimer.start();
}

int TestKJob::result()
{
    return mResult;
}

void TestKJob::onTimeout()
{
    emitResult();
}