3#include "ServiceThread.h" 
    4#include <QLoggingCategory> 
    6Q_DECLARE_LOGGING_CATEGORY(Service)
 
    8CServiceThread::CServiceThread(
CPluginService *pPlugin, QObject *parent)
 
   14CServiceThread::~CServiceThread()
 
   16    qDebug(Service) << 
"CServiceThread::~CServiceThread()";
 
   19void CServiceThread::run()
 
   24        qCritical(Service) << 
"GetService fail";
 
   27    qInfo(Service) << 
"The service" << m_pPlugin->
Name() << 
"is start";
 
   29    int nRet = pService->
Init();
 
   32        qWarning(Service) <<  
"The service" << m_pPlugin->
Name() << 
"initial fail";
 
   38    qInfo(Service) << 
"The service" << m_pPlugin->
Name() << 
"is stop";
 
   41    pService->deleteLater();
 
The service plugin interface.
 
virtual CService * NewService()=0
New service.
 
virtual const QString Name() const =0
This name must be the same as the project name (${PROJECT_NAME}).
 
virtual int Init()
Load parameters, support non-Qt event loop.