31 lines
830 B
C++
31 lines
830 B
C++
|
|
#include "derivedqthread.h"
|
|||
|
|
#include <QDebug>
|
|||
|
|
int callmain(char *args);
|
|||
|
|
DerivedQThread::DerivedQThread(const QString &exe, QObject *parent) :
|
|||
|
|
QThread(parent),mExe(exe)
|
|||
|
|
{
|
|||
|
|
connect(this,SIGNAL(finished()),this,SLOT(customedfinished()));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void DerivedQThread::run()
|
|||
|
|
{
|
|||
|
|
QDateTime dateTime;
|
|||
|
|
QTime second;
|
|||
|
|
dateTime=QDateTime::currentDateTime();
|
|||
|
|
second=QTime::currentTime();
|
|||
|
|
QString id;
|
|||
|
|
id=dateTime.toString();
|
|||
|
|
id+=QString::number(second.second());
|
|||
|
|
id+=QString::number(second.msec());
|
|||
|
|
this->mid=QCryptographicHash::hash ( id.toLatin1(), QCryptographicHash::Md5 ).toHex();
|
|||
|
|
//QProcess::execute(this->mExe);
|
|||
|
|
//char s;
|
|||
|
|
//std::string exe=this->mExe.toStdString();
|
|||
|
|
callmain("c:/parser/parser.xml");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void DerivedQThread::customedfinished()
|
|||
|
|
{
|
|||
|
|
emit this->finishedptr(this);
|
|||
|
|
}
|