From bb3a41883d20a34775213303b87f275ee8540afd Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Sun, 30 Apr 2017 21:10:49 +0200 Subject: [PATCH] sipify qgsoverlayanalyzer and qgsnewmemorylayer --- python/analysis/vector/qgsoverlayanalyzer.sip | 52 +++++++++----- python/auto_sip.blacklist | 2 - python/gui/qgsnewmemorylayerdialog.sip | 67 +++++++++++++++---- src/gui/qgsnewmemorylayerdialog.h | 4 +- 4 files changed, 92 insertions(+), 33 deletions(-) diff --git a/python/analysis/vector/qgsoverlayanalyzer.sip b/python/analysis/vector/qgsoverlayanalyzer.sip index 69f21bbe83b..fd550e1bca7 100644 --- a/python/analysis/vector/qgsoverlayanalyzer.sip +++ b/python/analysis/vector/qgsoverlayanalyzer.sip @@ -1,24 +1,46 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/analysis/vector/qgsoverlayanalyzer.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + -/** \ingroup analysis - * The Qgis class provides vector overlay analysis functions - */ class QgsOverlayAnalyzer { -%TypeHeaderCode -#include +%Docstring + The QGis class provides vector overlay analysis functions %End +%TypeHeaderCode +#include "qgsoverlayanalyzer.h" +%End public: - /** Perform an intersection on two input vector layers and write output to a new shape file - @param layerA input vector layer - @param layerB input vector layer - @param shapefileName path to the output shp - @param onlySelectedFeatures if true, only selected features are considered, else all the features - @param p progress dialog (or 0 if no progress dialog is to be shown) - */ - bool intersection( QgsVectorLayer* layerA, QgsVectorLayer* layerB, - const QString& shapefileName, bool onlySelectedFeatures = false, - QProgressDialog* p = 0 ); + bool intersection( QgsVectorLayer *layerA, QgsVectorLayer *layerB, + const QString &shapefileName, bool onlySelectedFeatures = false, + QProgressDialog *p = 0 ); +%Docstring + Perform an intersection on two input vector layers and write output to a new shape file +\param layerA input vector layer +\param layerB input vector layer +\param shapefileName path to the output shp +\param onlySelectedFeatures if true, only selected features are considered, else all the features +\param p progress dialog (or 0 if no progress dialog is to be shown) + :rtype: bool +%End + }; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/analysis/vector/qgsoverlayanalyzer.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/auto_sip.blacklist b/python/auto_sip.blacklist index 9366f41f249..18bec3ff33e 100644 --- a/python/auto_sip.blacklist +++ b/python/auto_sip.blacklist @@ -356,7 +356,6 @@ gui/qgsmessagebar.sip gui/qgsmessagebaritem.sip gui/qgsmessageviewer.sip gui/qgsnewhttpconnection.sip -gui/qgsnewmemorylayerdialog.sip gui/qgsnewnamedialog.sip gui/qgsnewvectorlayerdialog.sip gui/qgsnewgeopackagelayerdialog.sip @@ -505,7 +504,6 @@ gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.sip gui/layertree/qgslayertreeview.sip analysis/vector/qgsgeometryanalyzer.sip analysis/vector/qgsgeometrysnapper.sip -analysis/vector/qgsoverlayanalyzer.sip analysis/vector/qgspointsample.sip analysis/vector/qgstransectsample.sip analysis/vector/qgszonalstatistics.sip diff --git a/python/gui/qgsnewmemorylayerdialog.sip b/python/gui/qgsnewmemorylayerdialog.sip index 4b14ceac2f1..cd464446bf7 100644 --- a/python/gui/qgsnewmemorylayerdialog.sip +++ b/python/gui/qgsnewmemorylayerdialog.sip @@ -1,27 +1,66 @@ -class QgsNewMemoryLayerDialog : QDialog -{ -%TypeHeaderCode -#include -%End +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsnewmemorylayerdialog.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + +class QgsNewMemoryLayerDialog: QDialog +{ + +%TypeHeaderCode +#include "qgsnewmemorylayerdialog.h" +%End public: - /** Runs the dialoag and creates a new memory layer - * @param parent parent widget - * @returns new memory layer - */ - static QgsVectorLayer* runAndCreateLayer( QWidget* parent = 0 ); + static QgsVectorLayer *runAndCreateLayer( QWidget *parent = 0, const QgsCoordinateReferenceSystem &defaultCrs = QgsCoordinateReferenceSystem() ); +%Docstring + Runs the dialog and creates a new memory layer + \param parent parent widget + \param defaultCrs default layer CRS to show in dialog + :return: new memory layer + :rtype: QgsVectorLayer +%End - QgsNewMemoryLayerDialog( QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags ); + QgsNewMemoryLayerDialog( QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags ); ~QgsNewMemoryLayerDialog(); - /** Returns the selected geometry type*/ QgsWkbTypes::Type selectedType() const; +%Docstring +Returns the selected geometry type + :rtype: QgsWkbTypes.Type +%End void setCrs( const QgsCoordinateReferenceSystem &crs ); - QgsCoordinateReferenceSystem crs() const; +%Docstring + Sets the ``crs`` value for the new layer in the dialog. +.. versionadded:: 3.0 +.. seealso:: crs() +%End + + QgsCoordinateReferenceSystem crs() const; +%Docstring + Returns the selected CRS for the new layer. +.. seealso:: setCrs() + :rtype: QgsCoordinateReferenceSystem +%End - /** Returns the layer name*/ QString layerName() const; +%Docstring +Returns the layer name + :rtype: str +%End }; + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsnewmemorylayerdialog.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/src/gui/qgsnewmemorylayerdialog.h b/src/gui/qgsnewmemorylayerdialog.h index da78e4e8d71..27be54ca6cb 100644 --- a/src/gui/qgsnewmemorylayerdialog.h +++ b/src/gui/qgsnewmemorylayerdialog.h @@ -33,14 +33,14 @@ class GUI_EXPORT QgsNewMemoryLayerDialog: public QDialog, private Ui::QgsNewMemo public: - /** Runs the dialoag and creates a new memory layer + /** Runs the dialog and creates a new memory layer * \param parent parent widget * \param defaultCrs default layer CRS to show in dialog * \returns new memory layer */ static QgsVectorLayer *runAndCreateLayer( QWidget *parent = nullptr, const QgsCoordinateReferenceSystem &defaultCrs = QgsCoordinateReferenceSystem() ); - QgsNewMemoryLayerDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags ); + QgsNewMemoryLayerDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags ); ~QgsNewMemoryLayerDialog(); //! Returns the selected geometry type