我有以下几点:
QFutureWatcher<bool> *procwatcher;
procwatcher = new QFutureWatcher<bool>();
QFuture<bool> procfuture = QtConcurrent::run(this, &EraserBatch::processTile);
procwatcher->setFuture(procfuture);
QFutureWatcher<bool> *procwatcher2;
procwatcher2 = new QFutureWatcher<bool>();
QFuture<bool> procfuture2 = QtConcurrent::run(this, &EraserBatch::processTile);
procwatcher2->setFuture(procfuture2);创建这两种类型的动态大小数组的语法是什么- QFutureWatcher和QFuture,所以我可以说是procwatcher和procfuture1,等等。
谢谢!
发布于 2011-08-17 23:19:39
如果观察者不只由向量拥有的话:
typedef boost::shared_ptr<QFutureWatcher<bool> > ProcWatcherPtr;
std::vector<ProcWatcherPtr> procWatchers;如果观察者只由向量拥有的话:
typedef QFutureWatcher<bool> ProcWatcher
boost::ptr_vector<ProcWatcher> procWatchers;或者不使用内存分配,如果它适合您的需求:
std::vector<QFutureWatcher<bool> > procWatchers;https://stackoverflow.com/questions/7095139
复制相似问题