QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
Public Types | Public Member Functions | List of all members
QgsVectorLayerSaveAsDialog Class Reference

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

#include <qgsvectorlayersaveasdialog.h>

Inheritance diagram for QgsVectorLayerSaveAsDialog:
Inheritance graph
[legend]

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

Public Member Functions

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

Detailed Description

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

Note
not available in Python bindings
Since
QGIS 1.0

Definition at line 38 of file qgsvectorlayersaveasdialog.h.

Member Enumeration Documentation

◆ Options

Bitmask of options to be shown.

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

Definition at line 45 of file qgsvectorlayersaveasdialog.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerSaveAsDialog() [1/2]

QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog ( long  srsid,
QWidget *  parent = nullptr,
Qt::WindowFlags  fl = nullptr 
)

Construct a new QgsVectorLayerSaveAsDialog.

Definition at line 39 of file qgsvectorlayersaveasdialog.cpp.

◆ QgsVectorLayerSaveAsDialog() [2/2]

QgsVectorLayerSaveAsDialog::QgsVectorLayerSaveAsDialog ( QgsVectorLayer layer,
int  options = AllOptions,
QWidget *  parent = nullptr,
Qt::WindowFlags  fl = nullptr 
)

Construct a new QgsVectorLayerSaveAsDialog.

Definition at line 49 of file qgsvectorlayersaveasdialog.cpp.

Member Function Documentation

◆ addToCanvas()

bool QgsVectorLayerSaveAsDialog::addToCanvas ( ) const

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

See also
setAddToCanvas()

Definition at line 892 of file qgsvectorlayersaveasdialog.cpp.

◆ attributesAsDisplayedValues()

QgsAttributeList QgsVectorLayerSaveAsDialog::attributesAsDisplayedValues ( ) const

Returns selected attributes that must be exported with their displayed values instead of their raw values. Added in QGIS 2.16.

Definition at line 875 of file qgsvectorlayersaveasdialog.cpp.

◆ automaticGeometryType()

bool QgsVectorLayerSaveAsDialog::automaticGeometryType ( ) const

Returns true if geometry type is set to automatic.

See also
geometryType()

Definition at line 952 of file qgsvectorlayersaveasdialog.cpp.

◆ creationActionOnExistingFile()

QgsVectorFileWriter::ActionOnExistingFile QgsVectorLayerSaveAsDialog::creationActionOnExistingFile ( ) const

Returns creation action.

Definition at line 973 of file qgsvectorlayersaveasdialog.cpp.

◆ crs()

long QgsVectorLayerSaveAsDialog::crs ( ) const

Returns the internal CRS ID.

See also
QgsCoordinateReferenceSystem::srsid()

Definition at line 737 of file qgsvectorlayersaveasdialog.cpp.

◆ datasourceOptions()

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.

Definition at line 742 of file qgsvectorlayersaveasdialog.cpp.

◆ encoding()

QString QgsVectorLayerSaveAsDialog::encoding ( ) const

The encoding of the target file.

Definition at line 727 of file qgsvectorlayersaveasdialog.cpp.

◆ filename()

QString QgsVectorLayerSaveAsDialog::filename ( ) const

Returns the target filename.

Definition at line 717 of file qgsvectorlayersaveasdialog.cpp.

◆ filterExtent()

QgsRectangle QgsVectorLayerSaveAsDialog::filterExtent ( ) const

Determines the extent to be exported.

See also
hasFilterExtent()

Definition at line 925 of file qgsvectorlayersaveasdialog.cpp.

◆ forceMulti()

bool QgsVectorLayerSaveAsDialog::forceMulti ( ) const

Returns true if force multi geometry type is checked.

See also
includeZ()

Definition at line 958 of file qgsvectorlayersaveasdialog.cpp.

◆ format()

QString QgsVectorLayerSaveAsDialog::format ( ) const

The format in which the export should be written.

See also
QgsVectorFileWriter::filterForDriver()

Definition at line 732 of file qgsvectorlayersaveasdialog.cpp.

◆ geometryType()

QgsWkbTypes::Type QgsVectorLayerSaveAsDialog::geometryType ( ) const

Returns the selected flat geometry type for the export.

See also
automaticGeometryType()
forceMulti()
includeZ()

Definition at line 940 of file qgsvectorlayersaveasdialog.cpp.

◆ hasFilterExtent()

bool QgsVectorLayerSaveAsDialog::hasFilterExtent ( ) const

Determines if filtering the export by an extent is activated.

See also
filterExtent()

Definition at line 920 of file qgsvectorlayersaveasdialog.cpp.

◆ includeZ()

bool QgsVectorLayerSaveAsDialog::includeZ ( ) const

Returns true if include z dimension is checked.

See also
forceMulti()

Definition at line 968 of file qgsvectorlayersaveasdialog.cpp.

◆ layername()

QString QgsVectorLayerSaveAsDialog::layername ( ) const

Returns the target layer name.

Definition at line 722 of file qgsvectorlayersaveasdialog.cpp.

◆ layerOptions()

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.

Definition at line 801 of file qgsvectorlayersaveasdialog.cpp.

◆ onlySelected()

bool QgsVectorLayerSaveAsDialog::onlySelected ( ) const

Returns whether only selected features will be saved.

Definition at line 935 of file qgsvectorlayersaveasdialog.cpp.

◆ scale()

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.

Definition at line 907 of file qgsvectorlayersaveasdialog.cpp.

◆ selectedAttributes()

QgsAttributeList QgsVectorLayerSaveAsDialog::selectedAttributes ( ) const

Returns a list of attributes which are selected for saving.

Definition at line 860 of file qgsvectorlayersaveasdialog.cpp.

◆ setAddToCanvas()

void QgsVectorLayerSaveAsDialog::setAddToCanvas ( bool  checked)

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

See also
addToCanvas()
Since
QGIS 3.6

Definition at line 897 of file qgsvectorlayersaveasdialog.cpp.

◆ setForceMulti()

void QgsVectorLayerSaveAsDialog::setForceMulti ( bool  checked)

Sets whether the force multi geometry checkbox should be checked.

Definition at line 963 of file qgsvectorlayersaveasdialog.cpp.

◆ setIncludeZ()

void QgsVectorLayerSaveAsDialog::setIncludeZ ( bool  checked)

Sets whether the include z dimension checkbox should be checked.

Definition at line 978 of file qgsvectorlayersaveasdialog.cpp.

◆ setMapCanvas()

void QgsVectorLayerSaveAsDialog::setMapCanvas ( QgsMapCanvas canvas)

Sets a map canvas to associate with the dialog.

Definition at line 912 of file qgsvectorlayersaveasdialog.cpp.

◆ setOnlySelected()

void QgsVectorLayerSaveAsDialog::setOnlySelected ( bool  onlySelected)

Sets whether only selected features will be saved.

Definition at line 930 of file qgsvectorlayersaveasdialog.cpp.

◆ symbologyExport()

int QgsVectorLayerSaveAsDialog::symbologyExport ( ) const

Returns type of symbology export.

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

Definition at line 902 of file qgsvectorlayersaveasdialog.cpp.


The documentation for this class was generated from the following files: