Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_async_action_feedback.cpp File Reference
#include "kis_async_action_feedback.h"
#include <QApplication>
#include <QEventLoop>
#include <QFutureWatcher>
#include <QtConcurrentRun>
#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 39 of file kis_async_action_feedback.cpp.

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