Class: QgsVectorLayerSaveAsDialog

class qgis.gui.QgsVectorLayerSaveAsDialog

Bases: PyQt5.QtWidgets.QDialog

Class to select destination file, type and CRS for ogr layers

QgsVectorLayerSaveAsDialog(layer: QgsVectorLayer, options: Union[QgsVectorLayerSaveAsDialog.Options, QgsVectorLayerSaveAsDialog.Option] = QgsVectorLayerSaveAsDialog.Option.AllOptions, parent: QWidget = None, fl: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()) Construct a new QgsVectorLayerSaveAsDialog

Enums

Option

Bases: enum.IntEnum

Methods

accept

actionEvent

addToCanvas

Returns True if the "add to canvas" checkbox is checked.

attributesAsDisplayedValues

Returns selected attributes that must be exported with their displayed values instead of their raw values.

attributesExportNames

Returns a list of export names for attributes.

automaticGeometryType

Returns True if geometry type is set to automatic.

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

creationActionOnExistingFile

Returns the creation action.

crs

Returns the CRS chosen for export.

customEvent

datasourceOptions

Returns a list of additional data source options which are passed to OGR.

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

encoding

Returns the selected encoding for the target file.

enterEvent

event

eventFilter

fileName

Returns the target filename.

filterExtent

Determines the extent to be exported.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

forceMulti

Returns True if force multi geometry type is checked.

format

Returns the selected format in which the export should be written.

geometryType

Returns the selected flat geometry type for the export.

hasFilterExtent

Determines if filtering the export by an extent is activated.

hideEvent

includeZ

Returns True if include z dimension is checked.

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

layerName

Returns the target layer name.

layerOptions

Returns a list of additional layer options which are passed to OGR.

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

onlySelected

Returns whether only selected features will be saved.

paintEvent

persistMetadata

Returns True if the persist metadata (copy source metadata to destination layer) option is checked.

receivers

resizeEvent

scale

Returns the specified map scale.

selectedAttributes

Returns a list of attributes which are selected for saving.

sender

senderSignalIndex

setAddToCanvas

Sets whether the "add to canvas" checkbox should be checked.

setForceMulti

Sets whether the force multi geometry checkbox should be checked.

setIncludeZ

Sets whether the include z dimension checkbox should be checked.

setMapCanvas

Sets a map canvas to associate with the dialog.

setOnlySelected

Sets whether only selected features will be saved.

sharedPainter

showEvent

symbologyExport

Returns type of symbology export.

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

class Option(value)

Bases: enum.IntEnum

Available dialog options.

  • Symbology: Show symbology options

  • DestinationCrs: Show destination CRS (reprojection) option

  • Fields: Show field customization group

  • AddToCanvas: Show add to map option

  • SelectedOnly: Show selected features only option

  • GeometryType: Show geometry group

  • Extent: Show extent group

  • Metadata: Show metadata options

  • AllOptions:

AddToCanvas = 16
AllOptions = -1
DestinationCrs = 4
Extent = 128
Fields = 8
GeometryType = 64
Metadata = 256
SelectedOnly = 32
Symbology = 1
baseClass

alias of QgsVectorLayerSaveAsDialog

class Options
class Options(Union[QgsVectorLayerSaveAsDialog.Options, QgsVectorLayerSaveAsDialog.Option])
class Options(QgsVectorLayerSaveAsDialog.Options)

Bases: sip.wrapper

baseClass

alias of QgsVectorLayerSaveAsDialog

accept(self)
actionEvent(self, QActionEvent)
addToCanvas(self) bool

Returns True if the “add to canvas” checkbox is checked.

See also

setAddToCanvas()

Return type:

bool

attributesAsDisplayedValues(self) List[int]

Returns selected attributes that must be exported with their displayed values instead of their raw values.

Return type:

List[int]

attributesExportNames(self) List[str]

Returns a list of export names for attributes.

Return type:

List[str]

automaticGeometryType(self) bool

Returns True if geometry type is set to automatic.

See also

geometryType()

Return type:

bool

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
creationActionOnExistingFile(self) QgsVectorFileWriter.ActionOnExistingFile

Returns the creation action.

Return type:

QgsVectorFileWriter.ActionOnExistingFile

crs(self) QgsCoordinateReferenceSystem

Returns the CRS chosen for export.

New in version 3.14.

Return type:

QgsCoordinateReferenceSystem

customEvent(self, QEvent)
datasourceOptions(self) List[str]

Returns a list of additional data source options which are passed to OGR. Refer to the OGR documentation for the target format for available options.

See also

layerOptions()

Return type:

List[str]

destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
encoding(self) str

Returns the selected encoding for the target file.

Return type:

str

enterEvent(self, QEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
fileName(self) str

Returns the target filename.

See also

layerName()

Return type:

str

filterExtent(self) QgsRectangle

Determines the extent to be exported.

Return type:

QgsRectangle

focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
forceMulti(self) bool

Returns True if force multi geometry type is checked.

See also

includeZ()

See also

setForceMulti()

Return type:

bool

format(self) str

Returns the selected format in which the export should be written.

See also

QgsVectorFileWriter.filterForDriver()

Return type:

str

geometryType(self) Qgis.WkbType

Returns the selected flat geometry type for the export.

See also

forceMulti()

See also

includeZ()

Return type:

Qgis.WkbType

hasFilterExtent(self) bool

Determines if filtering the export by an extent is activated.

See also

filterExtent()

Return type:

bool

hideEvent(self, QHideEvent)
includeZ(self) bool

Returns True if include z dimension is checked.

See also

forceMulti()

See also

setIncludeZ()

Return type:

bool

initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
layerName(self) str

Returns the target layer name.

See also

fileName()

Return type:

str

layerOptions(self) List[str]

Returns a list of additional layer options which are passed to OGR. Refer to the OGR documentation for the target format for available options.

Return type:

List[str]

leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
onlySelected(self) bool

Returns whether only selected features will be saved.

Return type:

bool

paintEvent(self, QPaintEvent)
persistMetadata(self) bool

Returns True if the persist metadata (copy source metadata to destination layer) option is checked.

New in version 3.20.

Return type:

bool

receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
scale(self) float

Returns the specified map scale. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.

Return type:

float

selectedAttributes(self) List[int]

Returns a list of attributes which are selected for saving.

Return type:

List[int]

sender(self) QObject
senderSignalIndex(self) int
setAddToCanvas(self, checked: bool)

Sets whether the “add to canvas” checkbox should be checked.

See also

addToCanvas()

New in version 3.6.

Parameters:

checked (bool) –

setForceMulti(self, checked: bool)

Sets whether the force multi geometry checkbox should be checked.

See also

forceMulti()

Parameters:

checked (bool) –

setIncludeZ(self, checked: bool)

Sets whether the include z dimension checkbox should be checked.

See also

includeZ()

Parameters:

checked (bool) –

setMapCanvas(self, canvas: QgsMapCanvas)

Sets a map canvas to associate with the dialog.

Parameters:

canvas (QgsMapCanvas) –

setOnlySelected(self, onlySelected: bool)

Sets whether only selected features will be saved.

See also

onlySelected()

Parameters:

onlySelected (bool) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
symbologyExport(self) Qgis.FeatureSymbologyExport

Returns type of symbology export.

Return type:

Qgis.FeatureSymbologyExport

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)