Added some classes from a stackoverflow to utilize Qt's concurrency functions especially cancellable QFuture's

This commit is contained in:
eelke 2018-02-14 19:18:51 +01:00
parent ad3f605ada
commit 99d738ee65
5 changed files with 119 additions and 1 deletions

18
core/ControllableTask.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef CONTROLLABLETASK_H
#define CONTROLLABLETASK_H
/** From answer by Hatter
*
* https://stackoverflow.com/questions/5423058/qfuture-that-can-be-cancelled-and-report-progress
*/
#include "TaskControl.h"
template <class T>
class ControllableTask
{
public:
virtual ~ControllableTask() {}
virtual T run(TaskControl& control) = 0;
};
#endif // CONTROLLABLETASK_H