Added some classes from a stackoverflow to utilize Qt's concurrency functions especially cancellable QFuture's
This commit is contained in:
parent
ad3f605ada
commit
99d738ee65
5 changed files with 119 additions and 1 deletions
18
core/ControllableTask.h
Normal file
18
core/ControllableTask.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue