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. |
|
- 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)
- __init__(layer: QgsVectorLayer | None, uri: str | None, providerKey: str | None, exportOptions: QgsVectorLayerExporter.ExportOptions, providerOptions: Dict[str | None, Any] = {}, ownsLayer: bool = False)
Constructor for QgsVectorLayerExporterTask. Takes a source
layer, destinationuriandproviderKey, and various export related parameters via theexportOptionsargument.ownsLayerhas to be set toTrueif the task should take ownership of the layer and delete it after export.Added in version 3.44.
- Parameters:
layer (Optional[QgsVectorLayer])
uri (Optional[str])
providerKey (Optional[str])
exportOptions (QgsVectorLayerExporter.ExportOptions)
providerOptions (Dict[Optional[str], Any] = {})
ownsLayer (bool = False)
- signal errorOccurred[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal exportComplete[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- 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]