QgsTask task which runs a QgsProcessingAlgorithm in a background task.
More...
#include <qgsprocessingalgrunnertask.h>
|
void | executed (bool successful, const QVariantMap &results) |
| Emitted when the algorithm has finished execution. More...
|
|
void | begun () |
| Will be emitted by task to indicate its commencement. More...
|
|
void | progressChanged (double progress) |
| Will be emitted by task when its progress changes. More...
|
|
void | statusChanged (int status) |
| Will be emitted by task when its status changes. More...
|
|
void | taskCompleted () |
| Will be emitted by task to indicate its successful completion. More...
|
|
void | taskTerminated () |
| Will be emitted by task if it has terminated for any reason other then completion (e.g., when a task has been canceled or encountered an internal error). More...
|
|
|
void | finished (bool result) override |
| If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether through successful completion or via early termination). More...
|
|
bool | run () override |
| Performs the task's operation. More...
|
|
virtual void | finished (bool result) |
| If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether through successful completion or via early termination). More...
|
|
bool | isCanceled () const |
| Will return true if task should terminate ASAP. More...
|
|
virtual bool | run ()=0 |
| Performs the task's operation. More...
|
|
QgsTask task which runs a QgsProcessingAlgorithm in a background task.
- Since
- QGIS 3.0
Definition at line 35 of file qgsprocessingalgrunnertask.h.
◆ QgsProcessingAlgRunnerTask()
◆ algorithmCanceled()
bool QgsProcessingAlgRunnerTask::algorithmCanceled |
( |
| ) |
|
|
inline |
◆ cancel()
void QgsProcessingAlgRunnerTask::cancel |
( |
| ) |
|
|
overridevirtual |
Notifies the task that it should terminate.
Calling this is not guaranteed to immediately end the task, rather it sets the isCanceled() flag which task subclasses can check and terminate their operations at an appropriate time. Any subtasks owned by this task will also be canceled. Derived classes must ensure that the base class implementation is called from any overridden version.
- See also
- isCanceled()
Reimplemented from QgsTask.
Definition at line 53 of file qgsprocessingalgrunnertask.cpp.
◆ executed
void QgsProcessingAlgRunnerTask::executed |
( |
bool |
successful, |
|
|
const QVariantMap & |
results |
|
) |
| |
|
signal |
Emitted when the algorithm has finished execution.
If the algorithm completed execution without errors then successful will be true
. The results argument contains the results reported by the algorithm.
◆ finished()
void QgsProcessingAlgRunnerTask::finished |
( |
bool |
result | ) |
|
|
overrideprotectedvirtual |
If the task is managed by a QgsTaskManager, this will be called after the task has finished (whether through successful completion or via early termination).
The result argument reflects whether the task was successfully completed or not. This method is always called from the main thread, so it is safe to create widgets and perform other operations which require the main thread. However, the GUI will be blocked for the duration of this method so tasks should avoid performing any lengthy operations here.
Reimplemented from QgsTask.
Definition at line 81 of file qgsprocessingalgrunnertask.cpp.
◆ run()
bool QgsProcessingAlgRunnerTask::run |
( |
| ) |
|
|
overrideprotectedvirtual |
Performs the task's operation.
This method will be called when the task commences (ie via calling start() ), and subclasses should implement the operation they wish to perform in the background within this method.
A task must return a boolean value to indicate whether the task was completed successfully or terminated before completion.
Implements QgsTask.
Definition at line 60 of file qgsprocessingalgrunnertask.cpp.
The documentation for this class was generated from the following files: