增加线程运行方式
This commit is contained in:
@@ -31,6 +31,8 @@ void Parse::run()
|
||||
{
|
||||
QElapsedTimer time;
|
||||
time.start();
|
||||
//qDebug() << "parse thread:" << QThread::currentThreadId();
|
||||
|
||||
//qDebug() << "current thread is:" << QThread::currentThread();
|
||||
while (raw.size() > 0) {
|
||||
|
||||
@@ -1740,6 +1742,9 @@ void Parse::parseData(const int id, const QByteArray data)
|
||||
//raw.push_back(data);
|
||||
raw = data;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
QString str;
|
||||
|
||||
|
||||
@@ -195,7 +195,13 @@ void ToolsUI::btnClicked()
|
||||
|
||||
void ToolsUI::recieveDataSlot(const int &id, const QByteArray &data)
|
||||
{
|
||||
//qDebug() << "tools thread:" << QThread::currentThreadId();
|
||||
|
||||
Parse *parse = new Parse;
|
||||
|
||||
connect(this,&ToolsUI::parseData,
|
||||
parse,&Parse::parseData);
|
||||
|
||||
if(id == 0)
|
||||
{
|
||||
connect(parse,&Parse::INS_Info,
|
||||
@@ -261,6 +267,7 @@ void ToolsUI::recieveDataSlot(const int &id, const QByteArray &data)
|
||||
|
||||
QThreadPool::globalInstance()->start(parse);
|
||||
|
||||
//emit parseData(id,data);
|
||||
parse->parseData(id, data);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ signals:
|
||||
|
||||
void recieveData(const int &id,const QByteArray &data);
|
||||
|
||||
void parseData(const int &id,const QByteArray &data);
|
||||
|
||||
private:
|
||||
// QTimer timer;
|
||||
|
||||
Reference in New Issue
Block a user