Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_async_action_feedback.cpp File Reference
#include "kis_async_action_feedback.h"
#include <QtConcurrent>
#include <QProgressDialog>

Go to the source code of this file.

Classes

struct  KisAsyncActionFeedback::Private
 

Functions

template<typename T >
runActionImpl (std::function< T()> func)
 

Function Documentation

◆ runActionImpl()

template<typename T >
T runActionImpl ( std::function< T()> func)

Definition at line 36 of file kis_async_action_feedback.cpp.

37{
38 QFuture<T> result = QtConcurrent::run(func);
39 QFutureWatcher<T> watcher;
40 watcher.setFuture(result);
41
42 while (watcher.isRunning()) {
43 qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
44 }
45
46 watcher.waitForFinished();
47 return watcher.result();
48}