QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
QgsVectorLayerSaveAsDialog Class Reference

A dialog for configuring vector layer save to file operations. More...

#include <qgsvectorlayersaveasdialog.h>

Inheritance diagram for QgsVectorLayerSaveAsDialog:

Public Types

enum class  Option : int {
  Symbology = 1 , DestinationCrs = 1 << 2 , Fields = 1 << 3 , AddToCanvas = 1 << 4 ,
  SelectedOnly = 1 << 5 , GeometryType = 1 << 6 , Extent = 1 << 7 , Metadata = 1 << 8 ,
  AllOptions = ~0
}
 Available dialog options. More...
typedef QFlags< OptionOptions
 Available dialog options.

Public Member Functions

Q_DECL_DEPRECATED QgsVectorLayerSaveAsDialog (long srsid, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
 Construct a new QgsVectorLayerSaveAsDialog.
 QgsVectorLayerSaveAsDialog (QgsVectorLayer *layer, QgsVectorLayerSaveAsDialog::Options options=QgsVectorLayerSaveAsDialog::Option::AllOptions, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
 Construct a new QgsVectorLayerSaveAsDialog.
void accept () override
bool addToCanvas () const
 Returns true if the "add to canvas" checkbox is checked.
QgsAttributeList attributesAsDisplayedValues () const
 Returns selected attributes that must be exported with their displayed values instead of their raw values.
QStringList attributesExportNames () const
 Returns a list of export names for attributes.
bool automaticGeometryType () const
 Returns true if geometry type is set to automatic.
QgsVectorFileWriter::ActionOnExistingFile creationActionOnExistingFile () const
 Returns the creation action.
QgsCoordinateReferenceSystem crs () const
 Returns the CRS chosen for export.
QStringList datasourceOptions () const
 Returns a list of additional data source options which are passed to OGR.
QString encoding () const
 Returns the selected encoding for the target file.
QString fileName () const
 Returns the target filename.
QgsRectangle filterExtent () const
 Determines the extent to be exported.
bool forceMulti () const
 Returns true if force multi geometry type is checked.
QString format () const
 Returns the selected format in which the export should be written.
Qgis::WkbType geometryType () const
 Returns the selected flat geometry type for the export.
bool hasFilterExtent () const
 Determines if filtering the export by an extent is activated.
bool includeZ () const
 Returns true if include z dimension is checked.
QString layerName () const
 Returns the target layer name.
QStringList layerOptions () const
 Returns a list of additional layer options which are passed to OGR.
bool onlySelected () const
 Returns whether only selected features will be saved.
bool persistMetadata () const
 Returns true if the persist metadata (copy source metadata to destination layer) option is checked.
double scale () const
 Returns the specified map scale.
QgsAttributeList selectedAttributes () const
 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.
Qgis::FeatureSymbologyExport symbologyExport () const
 Returns type of symbology export.

Detailed Description

A dialog for configuring vector layer save to file operations.

Definition at line 34 of file qgsvectorlayersaveasdialog.h.

Member Typedef Documentation

◆ Options

Available dialog options.

Definition at line 60 of file qgsvectorlayersaveasdialog.h.

Member Enumeration Documentation

◆ Option

enum class QgsVectorLayerSaveAsDialog::Option : int
strong

Available dialog options.

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.

Metadata 

Show metadata options.

AllOptions 

Show all options.

Definition at line 43 of file qgsvectorlayersaveasdialog.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerSaveAsDialog() [1/2]

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

Construct a new QgsVectorLayerSaveAsDialog.

Deprecated
QGIS 3.14. Will be removed in QGIS 4.0.

Definition at line 46 of file qgsvectorlayersaveasdialog.cpp.

◆ QgsVectorLayerSaveAsDialog() [2/2]

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

Construct a new QgsVectorLayerSaveAsDialog.

Definition at line 54 of file qgsvectorlayersaveasdialog.cpp.

Member Function Documentation

◆ accept()

void QgsVectorLayerSaveAsDialog::accept ( )
override

Definition at line 312 of file qgsvectorlayersaveasdialog.cpp.

◆ addToCanvas()

bool QgsVectorLayerSaveAsDialog::addToCanvas ( ) const

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

See also
setAddToCanvas()

Definition at line 1094 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.

Definition at line 1070 of file qgsvectorlayersaveasdialog.cpp.

◆ attributesExportNames()

QStringList QgsVectorLayerSaveAsDialog::attributesExportNames ( ) const

Returns a list of export names for attributes.

Definition at line 1085 of file qgsvectorlayersaveasdialog.cpp.

◆ automaticGeometryType()

bool QgsVectorLayerSaveAsDialog::automaticGeometryType ( ) const

Returns true if geometry type is set to automatic.

See also
geometryType()

Definition at line 1161 of file qgsvectorlayersaveasdialog.cpp.

◆ creationActionOnExistingFile()

QgsVectorFileWriter::ActionOnExistingFile QgsVectorLayerSaveAsDialog::creationActionOnExistingFile ( ) const

Returns the creation action.

Definition at line 1182 of file qgsvectorlayersaveasdialog.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsVectorLayerSaveAsDialog::crs ( ) const

Returns the CRS chosen for export.

Since
QGIS 3.14

Definition at line 932 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.

See also
layerOptions()

Definition at line 937 of file qgsvectorlayersaveasdialog.cpp.

◆ encoding()

QString QgsVectorLayerSaveAsDialog::encoding ( ) const

Returns the selected encoding for the target file.

Definition at line 922 of file qgsvectorlayersaveasdialog.cpp.

◆ fileName()

QString QgsVectorLayerSaveAsDialog::fileName ( ) const

Returns the target filename.

See also
layerName()

Definition at line 912 of file qgsvectorlayersaveasdialog.cpp.

◆ filterExtent()

QgsRectangle QgsVectorLayerSaveAsDialog::filterExtent ( ) const

Determines the extent to be exported.

See also
hasFilterExtent()

Definition at line 1129 of file qgsvectorlayersaveasdialog.cpp.

◆ forceMulti()

bool QgsVectorLayerSaveAsDialog::forceMulti ( ) const

Returns true if force multi geometry type is checked.

See also
includeZ()
setForceMulti()

Definition at line 1167 of file qgsvectorlayersaveasdialog.cpp.

◆ format()

QString QgsVectorLayerSaveAsDialog::format ( ) const

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

See also
QgsVectorFileWriter::filterForDriver()

Definition at line 927 of file qgsvectorlayersaveasdialog.cpp.

◆ geometryType()

Qgis::WkbType QgsVectorLayerSaveAsDialog::geometryType ( ) const

Returns the selected flat geometry type for the export.

See also
automaticGeometryType()
forceMulti()
includeZ()

Definition at line 1149 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 1124 of file qgsvectorlayersaveasdialog.cpp.

◆ includeZ()

bool QgsVectorLayerSaveAsDialog::includeZ ( ) const

Returns true if include z dimension is checked.

See also
forceMulti()
setIncludeZ()

Definition at line 1177 of file qgsvectorlayersaveasdialog.cpp.

◆ layerName()

QString QgsVectorLayerSaveAsDialog::layerName ( ) const

Returns the target layer name.

See also
fileName()

Definition at line 917 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.

See also
datasourceOptions()

Definition at line 996 of file qgsvectorlayersaveasdialog.cpp.

◆ onlySelected()

bool QgsVectorLayerSaveAsDialog::onlySelected ( ) const

Returns whether only selected features will be saved.

See also
setOnlySelected()

Definition at line 1139 of file qgsvectorlayersaveasdialog.cpp.

◆ persistMetadata()

bool QgsVectorLayerSaveAsDialog::persistMetadata ( ) const

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

Since
QGIS 3.20

Definition at line 1144 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 1111 of file qgsvectorlayersaveasdialog.cpp.

◆ selectedAttributes()

QgsAttributeList QgsVectorLayerSaveAsDialog::selectedAttributes ( ) const

Returns a list of attributes which are selected for saving.

Definition at line 1055 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 1099 of file qgsvectorlayersaveasdialog.cpp.

◆ setForceMulti()

void QgsVectorLayerSaveAsDialog::setForceMulti ( bool checked)

Sets whether the force multi geometry checkbox should be checked.

See also
forceMulti()

Definition at line 1172 of file qgsvectorlayersaveasdialog.cpp.

◆ setIncludeZ()

void QgsVectorLayerSaveAsDialog::setIncludeZ ( bool checked)

Sets whether the include z dimension checkbox should be checked.

See also
includeZ()

Definition at line 1187 of file qgsvectorlayersaveasdialog.cpp.

◆ setMapCanvas()

void QgsVectorLayerSaveAsDialog::setMapCanvas ( QgsMapCanvas * canvas)

Sets a map canvas to associate with the dialog.

Definition at line 1116 of file qgsvectorlayersaveasdialog.cpp.

◆ setOnlySelected()

void QgsVectorLayerSaveAsDialog::setOnlySelected ( bool onlySelected)

Sets whether only selected features will be saved.

See also
onlySelected()

Definition at line 1134 of file qgsvectorlayersaveasdialog.cpp.

◆ symbologyExport()

Qgis::FeatureSymbologyExport QgsVectorLayerSaveAsDialog::symbologyExport ( ) const

Returns type of symbology export.

Definition at line 1106 of file qgsvectorlayersaveasdialog.cpp.


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