qfuture

Assigning to running QFuture

时光毁灭记忆、已成空白 提交于 2021-01-29 02:30:20
问题 Can I assign another QFuture object to already running QFuture object? Like in the example below: QFuture<int> future = QtConcurrent::run(function); future = QtConcurrent::run(anotherFunciton); //assume that future is still running at this point I realize that this particular example doesn't make much sense, it's just for the sake of example. Is it safe to make such an assigment, assuming that the result of the first function doesn't interest me anymore? Or do I have to cancel it first? And

QFuture that can be cancelled and report progress

北战南征 提交于 2019-11-28 17:38:50
The QFuture class has methods such as cancel() , progressValue() , etc. These can apparently be monitored via a QFutureWatcher . However, the documentation for QtConcurrent::run() reads: Note that the QFuture returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The QFuture returned can only be used to query for the running/finished status and the return value of the function. I have looked in vain for what method actually can create a QFuture that can be cancelled and report progress for a single long-running operation. (It looks like maybe QtConcurrent:

QFuture that can be cancelled and report progress

我怕爱的太早我们不能终老 提交于 2019-11-27 20:02:39
问题 The QFuture class has methods such as cancel() , progressValue() , etc. These can apparently be monitored via a QFutureWatcher . However, the documentation for QtConcurrent::run() reads: Note that the QFuture returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The QFuture returned can only be used to query for the running/finished status and the return value of the function. I have looked in vain for what method actually can create a QFuture that can be