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 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
/* Copyright (c) 2020, Dyssol Development Team. All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */
#include "BasicThread.h"
CBasicThread::CBasicThread(QObject *parent /*= nullptr*/)
: QObject(parent)
{
connect(&m_Thread, &QThread::started, this, &CBasicThread::StartTask);
}
void CBasicThread::Run()
{
this->moveToThread(&m_Thread);
m_Thread.start();
}
void CBasicThread::Stop()
{
m_Thread.exit();
}
bool CBasicThread::IsRunning() const
{
return m_Thread.isRunning();
}
bool CBasicThread::IsFinished() const
{
return m_Thread.isFinished();
}
bool CBasicThread::Wait(unsigned long _nTime /*= ULONG_MAX */)
{
return m_Thread.wait(_nTime);
}
void CBasicThread::StartTask()
{
emit Finished();
}
void CBasicThread::RequestStop()
{
}
|