Class: QgsProxyProgressTask

A QgsTask shell which proxies progress reports.

Simple task shell which runs until finalized and reports progress only. This is usually used to expose a blocking operation’s progress via task manager.

Added in version 3.4.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProxyProgressTask

Base classes

QgsTask

Abstract base class for long running background tasks.

QObject

Methods

finalize

Finalizes the task, with the specified result.

setProxyProgress

Sets the progress (from 0 to 100) for the proxied operation.

Signals

canceled

Emitted when the task is canceled.

class qgis.core.QgsProxyProgressTask[source]

Bases: QgsTask

__init__(description: str | None, canCancel: bool = False)

Constructor for QgsProxyProgressTask, with the specified description.

Parameters:
  • description (Optional[str])

  • canCancel (bool = False)

signal canceled[source]

Emitted when the task is canceled.

Added in version 3.26.

finalize(self, result: bool)[source]

Finalizes the task, with the specified result.

This should be called when the operation being proxied has completed, to remove this proxy task from the task manager.

Parameters:

result (bool)

setProxyProgress(self, progress: float)[source]

Sets the progress (from 0 to 100) for the proxied operation.

This method is safe to call from the main thread.

Parameters:

progress (float)