Skip to content

Commit

Permalink
added QgsVectorLayerSaveAsDialog to public API
Browse files Browse the repository at this point in the history
  • Loading branch information
jakimowb authored and nyalldawson committed May 12, 2023
1 parent 9488e0b commit d3b91ca
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 4 deletions.
252 changes: 252 additions & 0 deletions python/gui/auto_generated/ogr/qgsvectorlayersaveasdialog.sip.in
@@ -0,0 +1,252 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/ogr/qgsvectorlayersaveasdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsVectorLayerSaveAsDialog : QDialog
{
%Docstring(signature="appended")
Class to select destination file, type and CRS for ogr layers

.. note::

not available in Python bindings

.. versionadded:: 1.0
%End

%TypeHeaderCode
#include "qgsvectorlayersaveasdialog.h"
%End
public:

enum Option
{
Symbology,
DestinationCrs,
Fields,
AddToCanvas,
SelectedOnly,
GeometryType,
Extent,
Metadata,
AllOptions
};
typedef QFlags<QgsVectorLayerSaveAsDialog::Option> Options;


QgsVectorLayerSaveAsDialog( long srsid, QWidget *parent = 0, Qt::WindowFlags fl = Qt::WindowFlags() );
%Docstring
Construct a new QgsVectorLayerSaveAsDialog

.. deprecated:: QGIS 3.14
- will be removed in QGIS 4.0
%End

QgsVectorLayerSaveAsDialog( QgsVectorLayer *layer, Options options = AllOptions, QWidget *parent = 0, Qt::WindowFlags fl = Qt::WindowFlags() );
%Docstring
Construct a new QgsVectorLayerSaveAsDialog
%End

QString format() const;
%Docstring
The format in which the export should be written.

.. seealso:: :py:func:`QgsVectorFileWriter.filterForDriver`
%End

QString encoding() const;
%Docstring
The encoding of the target file.
%End

QString filename() const;
%Docstring
Returns the target filename.
%End

QString layername() const;
%Docstring
Returns the target layer name
%End

QStringList datasourceOptions() const;
%Docstring
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.
%End

QStringList layerOptions() const;
%Docstring
Returns a list of additional layer options which are passed to OGR.
Refer to the OGR documentation for the target format for available options.
%End

long crs() const;
%Docstring
Returns the internal CRS ID.

.. seealso:: :py:func:`QgsCoordinateReferenceSystem.srsid`

.. deprecated:: QGIS 3.14
- will be removed in QGIS 4.0. Use :py:func:`~QgsVectorLayerSaveAsDialog.crsObject` instead.
%End

QgsCoordinateReferenceSystem crsObject() const;
%Docstring
Returns the CRS chosen for export

.. versionadded:: 3.14
%End

QgsAttributeList selectedAttributes() const;
%Docstring
Returns a list of attributes which are selected for saving.
%End
QgsAttributeList attributesAsDisplayedValues() const;
%Docstring
Returns selected attributes that must be exported with their displayed values instead of their raw values. Added in QGIS 2.16
%End

QStringList attributesExportNames() const;
%Docstring
Returns a list of export names for attributes
%End

bool addToCanvas() const;
%Docstring
Returns ``True`` if the "add to canvas" checkbox is checked.

.. seealso:: :py:func:`setAddToCanvas`
%End

void setAddToCanvas( bool checked );
%Docstring
Sets whether the "add to canvas" checkbox should be ``checked``.

.. seealso:: :py:func:`addToCanvas`

.. versionadded:: 3.6
%End

int symbologyExport() const;
%Docstring
Returns type of symbology export.
0: No symbology
1: Feature symbology
2: Symbol level symbology
%End

double scale() const;
%Docstring
Returns the specified map scale.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
%End

void setMapCanvas( QgsMapCanvas *canvas );
%Docstring
Sets a map ``canvas`` to associate with the dialog.
%End

bool hasFilterExtent() const;
%Docstring
Determines if filtering the export by an extent is activated.

.. seealso:: :py:func:`filterExtent`
%End

QgsRectangle filterExtent() const;
%Docstring
Determines the extent to be exported.

.. seealso:: :py:func:`hasFilterExtent`
%End

void setOnlySelected( bool onlySelected );
%Docstring
Sets whether only selected features will be saved.
%End

bool onlySelected() const;
%Docstring
Returns whether only selected features will be saved.
%End

bool persistMetadata() const;
%Docstring
Returns ``True`` if the persist metadata (copy source metadata to destination layer) option is checked.

.. versionadded:: 3.20
%End

Qgis::WkbType geometryType() const;
%Docstring
Returns the selected flat geometry type for the export.

.. seealso:: :py:func:`automaticGeometryType`

.. seealso:: :py:func:`forceMulti`

.. seealso:: :py:func:`includeZ`
%End

bool automaticGeometryType() const;
%Docstring
Returns ``True`` if geometry type is set to automatic.

.. seealso:: :py:func:`geometryType`
%End

bool forceMulti() const;
%Docstring
Returns ``True`` if force multi geometry type is checked.

.. seealso:: :py:func:`includeZ`
%End

void setForceMulti( bool checked );
%Docstring
Sets whether the force multi geometry checkbox should be checked.
%End

bool includeZ() const;
%Docstring
Returns ``True`` if include z dimension is checked.

.. seealso:: :py:func:`forceMulti`
%End

void setIncludeZ( bool checked );
%Docstring
Sets whether the include z dimension checkbox should be checked.
%End

QgsVectorFileWriter::ActionOnExistingFile creationActionOnExistingFile() const;
%Docstring
Returns creation action
%End


virtual void accept();


};

QFlags<QgsVectorLayerSaveAsDialog::Option> operator|(QgsVectorLayerSaveAsDialog::Option f1, QFlags<QgsVectorLayerSaveAsDialog::Option> f2);



/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/ogr/qgsvectorlayersaveasdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
6 changes: 2 additions & 4 deletions src/gui/ogr/qgsvectorlayersaveasdialog.h
Expand Up @@ -23,14 +23,11 @@
#include "qgsvectorfilewriter.h"
#include "qgis_gui.h"

#define SIP_NO_FILE

class QgsVectorLayer;

/**
* \ingroup gui
* \brief Class to select destination file, type and CRS for ogr layers
* \note not available in Python bindings
* \since QGIS 1.0
*/
class GUI_EXPORT QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSaveAsDialogBase
Expand Down Expand Up @@ -226,14 +223,15 @@ class GUI_EXPORT QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVec
//! Returns creation action
QgsVectorFileWriter::ActionOnExistingFile creationActionOnExistingFile() const;

void accept() override;

private slots:

void mFormatComboBox_currentIndexChanged( int idx );
void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
void showHelp();
void mSymbologyExportComboBox_currentIndexChanged( const QString &text );
void mGeometryTypeComboBox_currentIndexChanged( int index );
void accept() override;
void mSelectAllAttributes_clicked();
void mDeselectAllAttributes_clicked();
void mUseAliasesForExportedName_stateChanged( int state );
Expand Down

0 comments on commit d3b91ca

Please sign in to comment.