Quote Originally Posted by wysota View Post
You can cancel a future directly, you don't need a watcher for this.
thanks!

i forgot to add that i also decided to use a watcher because this seems to be the easiest way to also have throttling - so the original question remains.
if the method above (call cancel on the watcher and immediately set a new future) could cause problems, i'll probably drop the watcher, and implement throttling by a QSemaphore. another way would be to re-use the watcher with a new future and cancel the previous future afterwards.

another question in this regards: the docs state that a QFuture is reference counted, but what does that mean to the lifetime of i.e. a QFuture object returned by QtConcurrent? does adding and removing a future to/from a watcher (the way i do it above) trigger reference counting, and would that mean that the future is destroyed when it is removed from the (last) watcher, even if it is still working? somehow i don't get a clear view on this by what the docs say...