QgsVectorLayerSaveAsDialog class

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

Public types

enum Options { Symbology = 1, DestinationCrs = 1 << 2, Fields = 1 << 3, AddToCanvas = 1 << 4, SelectedOnly = 1 << 5, GeometryType = 1 << 6, Extent = 1 << 7, AllOptions = ~0 }
Bitmask of options to be shown.

Constructors, destructors, conversion operators

QgsVectorLayerSaveAsDialog(long srsid, QWidget* parent = nullptr, Qt::WindowFlags fl = nullptr)
Construct a new QgsVectorLayerSaveAsDialog.
QgsVectorLayerSaveAsDialog(QgsVectorLayer* layer, int options = AllOptions, QWidget* parent = nullptr, Qt::WindowFlags fl = nullptr)
Construct a new QgsVectorLayerSaveAsDialog.

Public functions

auto addToCanvas() const -> bool
Returns true if the "add to canvas" checkbox is checked.
auto attributesAsDisplayedValues() const -> QgsAttributeList
Returns selected attributes that must be exported with their displayed values instead of their raw values. Added in QGIS 2.16.
auto automaticGeometryType() const -> bool
Returns true if geometry type is set to automatic.
auto creationActionOnExistingFile() const -> QgsVectorFileWriter::ActionOnExistingFile
Returns creation action.
auto crs() const -> long
Returns the internal CRS ID.
auto datasourceOptions() const -> QStringList
Returns a list of additional data source options which are passed to OGR.
auto encoding() const -> QString
The encoding of the target file.
auto filename() const -> QString
Returns the target filename.
auto filterExtent() const -> QgsRectangle
Determines the extent to be exported.
auto forceMulti() const -> bool
Returns true if force multi geometry type is checked.
auto format() const -> QString
The format in which the export should be written.
auto geometryType() const -> QgsWkbTypes::Type
Returns the selected flat geometry type for the export.
auto hasFilterExtent() const -> bool
Determines if filtering the export by an extent is activated.
auto includeZ() const -> bool
Returns true if include z dimension is checked.
auto layername() const -> QString
Returns the target layer name.
auto layerOptions() const -> QStringList
Returns a list of additional layer options which are passed to OGR.
auto onlySelected() const -> bool
Returns whether only selected features will be saved.
auto scale() const -> double
Returns the specified map scale.
auto selectedAttributes() const -> QgsAttributeList
Returns a list of attributes which are selected for saving.
void setAddToCanvas(bool checked)
Sets whether the "add to canvas" checkbox should be checked.
void setForceMulti(bool checked)
Sets whether the force multi geometry checkbox should be checked.
void setIncludeZ(bool checked)
Sets whether the include z dimension checkbox should be checked.
void setMapCanvas(QgsMapCanvas* canvas)
Sets a map canvas to associate with the dialog.
void setOnlySelected(bool onlySelected)
Sets whether only selected features will be saved.
auto symbologyExport() const -> int
Returns type of symbology export.

Enum documentation

enum QgsVectorLayerSaveAsDialog::Options

Bitmask of options to be shown.

Enumerators
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.

AllOptions

Show all options.

Function documentation

bool QgsVectorLayerSaveAsDialog::addToCanvas() const

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

bool QgsVectorLayerSaveAsDialog::automaticGeometryType() const

Returns true if geometry type is set to automatic.

long QgsVectorLayerSaveAsDialog::crs() const

Returns the internal CRS ID.

QStringList QgsVectorLayerSaveAsDialog::datasourceOptions() const

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.

QgsRectangle QgsVectorLayerSaveAsDialog::filterExtent() const

Determines the extent to be exported.

bool QgsVectorLayerSaveAsDialog::forceMulti() const

Returns true if force multi geometry type is checked.

QString QgsVectorLayerSaveAsDialog::format() const

The format in which the export should be written.

QgsWkbTypes::Type QgsVectorLayerSaveAsDialog::geometryType() const

Returns the selected flat geometry type for the export.

bool QgsVectorLayerSaveAsDialog::hasFilterExtent() const

Determines if filtering the export by an extent is activated.

bool QgsVectorLayerSaveAsDialog::includeZ() const

Returns true if include z dimension is checked.

QStringList QgsVectorLayerSaveAsDialog::layerOptions() const

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

Refer to the OGR documentation for the target format for available options.

double QgsVectorLayerSaveAsDialog::scale() const

Returns the specified map scale.

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

void QgsVectorLayerSaveAsDialog::setAddToCanvas(bool checked)

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

int QgsVectorLayerSaveAsDialog::symbologyExport() const

Returns type of symbology export.

0: No symbology 1: Feature symbology 2: Symbol level symbology