Class: QgsCopyFileTask

Task to copy a file on disk.

Added in version 3.22.

Class Hierarchy

Inheritance diagram of qgis.core.QgsCopyFileTask

Base classes

QgsTask

Abstract base class for long running background tasks.

QObject

class qgis.core.QgsCopyFileTask[source]

Bases: QgsTask

__init__(source: str | None, destination: str | None)

Creates a task that copy source file to destination

Parameters:
  • source (Optional[str])

  • destination (Optional[str])

destination(self) str

It could be different from the original one. If original destination was a directory the returned destination is now the absolute file path of the copied file

Return type:

str

errorString(self) str

Returns errorString if an error occurred, else returns an empty string

Return type:

str