wookoon
27th July 2010, 12:11
Hi , all
I need compute some different data at one time ,so I use the QtConcurrent:run to
compute the data , and use QFutrueWatcher to monitor the computing state.
Here is the a section of the code.
**.h
QVector<QFuture<void> *> ftVec;
QVector<QFutureWatcher<void> *> ftwVec;
**.cpp
//begin a new computation.
ftVec << new QFuture<void>;
ftwVec << new QFutureWatcher<void>;
connect(ftwVec[num], SIGNAL(finished()),this, SLOT(getresultFunction()));
*ftVec[num] = QtConcurrent::run(this,&MainWindow::computeFuntion);
ftwVec[num]->setFuture(*ftVec[num]);
num++;
I want know which watcher is finished when it execute the function getresultFunction.
Give me some suggestions. Thanks..!
I need compute some different data at one time ,so I use the QtConcurrent:run to
compute the data , and use QFutrueWatcher to monitor the computing state.
Here is the a section of the code.
**.h
QVector<QFuture<void> *> ftVec;
QVector<QFutureWatcher<void> *> ftwVec;
**.cpp
//begin a new computation.
ftVec << new QFuture<void>;
ftwVec << new QFutureWatcher<void>;
connect(ftwVec[num], SIGNAL(finished()),this, SLOT(getresultFunction()));
*ftVec[num] = QtConcurrent::run(this,&MainWindow::computeFuntion);
ftwVec[num]->setFuture(*ftVec[num]);
num++;
I want know which watcher is finished when it execute the function getresultFunction.
Give me some suggestions. Thanks..!