Skip to content

Prefer QThreadPool over QtConcurrent where we don't care about result

Vlad Zahorodnii requested to merge work/zzag/less-qtconcurrent into master

QtConcurrent::run()'s return type is marked with [[nodiscard]], which is not nice to code that just needs to move some tasks to a worker thread.

On the other hand, QThreadPool satisfies our needs too and Qt doesn't need to construct futures that we won't use.

One remark about the screenshot plugin: the task lambda is mutable so it cannot be represented using a std::function.

Merge request reports

Loading