19#include "moc_qgsproxyprogresstask.cpp"
30 const QMutexLocker lock( &mNotFinishedMutex );
31 mAlreadyFinished =
true;
34 mNotFinishedWaitCondition.wakeAll();
40 mNotFinishedMutex.lock();
41 if ( !mAlreadyFinished )
43 mNotFinishedWaitCondition.wait( &mNotFinishedMutex );
45 mNotFinishedMutex.unlock();
53 QMetaObject::invokeMethod(
this,
"setProgress", Qt::AutoConnection, Q_ARG(
double,
progress ) );
static QgsTaskManager * taskManager()
Returns the application's task manager, used for managing application wide background task handling.
A QgsTask shell which proxies progress reports.
void setProxyProgress(double progress)
Sets the progress (from 0 to 100) for the proxied operation.
void finalize(bool result)
Finalizes the task, with the specified result.
void canceled()
Emitted when the task is canceled.
void cancel() override
Notifies the task that it should terminate.
bool run() override
Performs the task's operation.
QgsProxyProgressTask(const QString &description, bool canCancel=false)
Constructor for QgsProxyProgressTask, with the specified description.
void setProgress(double progress)
Sets the progress (from 0 to 100) for the proxied operation.
~QgsScopedProxyProgressTask()
QgsScopedProxyProgressTask(const QString &description)
Constructor for QgsScopedProxyProgressTask, with the specified description.
QThreadPool * threadPool()
Returns the threadpool utilized by the task manager.
long addTask(QgsTask *task, int priority=0)
Adds a task to the manager.
Abstract base class for long running background tasks.
double progress() const
Returns the task's progress (between 0.0 and 100.0)
virtual void cancel()
Notifies the task that it should terminate.