Class: QgsVectorLayerExporterTask¶
QgsTask task which performs a
QgsVectorLayerExporter layer export operation as a
background task. This can be used to export a vector layer out to a
provider without blocking the QGIS interface.
See also
See also
Class Hierarchy¶
Base classes¶
Abstract base class for long running background tasks.  | 
|
Static Methods
Creates a new   | 
Signals
Emitted when an error occurs which prevented the layer being exported (or if the task is canceled).  | 
|
Emitted when exporting the layer is successfully completed.  | 
- class qgis.core.QgsVectorLayerExporterTask[source]¶
 Bases:
QgsTask- __init__(layer: QgsVectorLayer | None, uri: str | None, providerKey: str | None, destinationCrs: QgsCoordinateReferenceSystem, options: Dict[str | None, Any] = {}, ownsLayer: bool = False)
 Constructor for QgsVectorLayerExporterTask. Takes a source
layer, destinationuriandproviderKey, and various export related parameters such as destination CRS and exportoptions.ownsLayerhas to be set toTrueif the task should take ownership of the layer and delete it after export.- Parameters:
 layer (Optional[QgsVectorLayer])
uri (Optional[str])
providerKey (Optional[str])
destinationCrs (QgsCoordinateReferenceSystem)
options (Dict[Optional[str], Any] = {})
ownsLayer (bool = False)
- signal errorOccurred(error: Qgis.VectorExportResult, errorMessage: str)[source]¶
 Emitted when an error occurs which prevented the layer being exported (or if the task is canceled). The export
erroranderrorMessagewill be reported.- Parameters:
 error (Qgis.VectorExportResult)
errorMessage (str)
- static withLayerOwnership(layer: QgsVectorLayer | None, uri: str | None, providerKey: str | None, destinationCrs: QgsCoordinateReferenceSystem, options: Dict[str | None, Any] = {}) QgsVectorLayerExporterTask | None[source]¶
 Creates a new
QgsVectorLayerExporterTaskwhich has ownership over a sourcelayer. When the export task has completed (successfully or otherwise)layerwill be deleted. The destinationuriandproviderKey, and various export related parameters such as destination CRS and exportoptionsmust be specified.- Parameters:
 layer (Optional[QgsVectorLayer])
uri (Optional[str])
providerKey (Optional[str])
destinationCrs (QgsCoordinateReferenceSystem)
options (Dict[Optional[str], Any] = {})
- Return type:
 Optional[QgsVectorLayerExporterTask]