#ifndef QSTHREAD_H
#define QSTHREAD_H

#include <QThread>
#include <QMutex>
#include <QDebug>
#include <QMutexLocker>

class QSThread : public QThread
{

    Q_OBJECT
public:
    QSThread();
    virtual ~QSThread();

    void ChangeState(int nState);
    int GetCurrentState();

    virtual void IdleFuction();

    virtual void ExitThread();

    virtual void TerminateThread();


public slots:
signals:
    //void captureImage(QString strFilename);


protected:
    int m_nDefaultMicroSleep;
    void run();
    virtual void InnerRun();

    virtual void Init();

    bool m_bStop;
    bool m_bRunning;
    int m_nCurrentState;
};

#endif // QSTHREAD_H
