diff --git a/.gitignore b/.gitignore index f8d3ce9263c..34f7fed68eb 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ /CMakeLists.txt.user /CMakeLists.txt.user.* api_doc -*build* +/build* debian/*.debhelper debian/*.substvars desktop.ini diff --git a/python/analysis/network/qgsgraphbuilder.sip.in b/python/analysis/network/qgsgraphbuilder.sip.in new file mode 100644 index 00000000000..75bf966d1ba --- /dev/null +++ b/python/analysis/network/qgsgraphbuilder.sip.in @@ -0,0 +1,55 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/analysis/network/qgsgraphbuilder.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + + +class QgsGraphBuilder : QgsGraphBuilderInterface +{ +%Docstring + This class used for making the QgsGraph object +%End + +%TypeHeaderCode +#include "qgsgraphbuilder.h" +%End + public: + + QgsGraphBuilder( const QgsCoordinateReferenceSystem &crs, bool otfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" ); +%Docstring +Default constructor +%End + + ~QgsGraphBuilder(); + + virtual void addVertex( int id, const QgsPointXY &pt ); + +%Docstring +MANDATORY BUILDER PROPERTY DECLARATION +%End + + virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &prop ); + + + QgsGraph *graph() /Factory/; +%Docstring +Returns generated :py:class:`QgsGraph` +%End + +}; + + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/analysis/network/qgsgraphbuilder.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/analysis/network/qgsgraphbuilderinterface.sip.in b/python/analysis/network/qgsgraphbuilderinterface.sip.in new file mode 100644 index 00000000000..ddd3dc73f19 --- /dev/null +++ b/python/analysis/network/qgsgraphbuilderinterface.sip.in @@ -0,0 +1,102 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/analysis/network/qgsgraphbuilderinterface.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + +%ModuleHeaderCode +#include +%End + +class QgsGraphBuilderInterface +{ +%Docstring + Determine interface for creating a graph. Contains the settings of the graph. +QgsGraphBuilder and QgsGraphDirector both use a "builder" design pattern +%End + +%TypeHeaderCode +#include "qgsgraphbuilderinterface.h" +%End +%ConvertToSubClassCode + if ( dynamic_cast< QgsGraphBuilder * >( sipCpp ) != NULL ) + sipType = sipType_QgsGraphBuilder; + else + sipType = NULL; +%End + public: + + QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" ); +%Docstring +Default constructor + +:param crs: Coordinate reference system for new graph vertex +:param ctfEnabled: enable coordinate transform from source graph CRS to CRS graph +:param topologyTolerance: sqrt distance between source point as one graph vertex +:param ellipsoidID: ellipsoid for edge measurement +%End + + virtual ~QgsGraphBuilderInterface(); + + QgsCoordinateReferenceSystem destinationCrs() const; +%Docstring +Returns destinaltion CRS +%End + + bool coordinateTransformationEnabled(); +%Docstring +Returns coordinate transformation enabled +%End + + double topologyTolerance(); +%Docstring +Returns topology tolerance +%End + + QgsDistanceArea *distanceArea(); +%Docstring +Returns measurement tool +%End + + virtual void addVertex( int id, const QgsPointXY &pt ); +%Docstring +Add vertex to the graph + +:param id: vertex identifier +:param pt: vertex coordinates + +.. note:: + + id and pt are redundant. You can use pt or id to identify the vertex +%End + + virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies ); +%Docstring +Add edge to the graph + +:param pt1id: first vertex identificator +:param pt1: first vertex coordinates +:param pt2id: second vertex identificator +:param pt2: second vertex coordinates +:param strategies: optimization strategies + +.. note:: + + pt1id, pt1 and pt2id, pt2 is a redundant interface. You can use vertex coordinates or their identificators. +%End + +}; + + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/analysis/network/qgsgraphbuilderinterface.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/gui/qgsexpressionbuilderdialog.sip.in b/python/gui/qgsexpressionbuilderdialog.sip.in new file mode 100644 index 00000000000..8ae5c5b23dc --- /dev/null +++ b/python/gui/qgsexpressionbuilderdialog.sip.in @@ -0,0 +1,114 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsexpressionbuilderdialog.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + +class QgsExpressionBuilderDialog : QDialog +{ +%Docstring +A generic dialog for building expression strings +@remarks This class also shows an example on how to use QgsExpressionBuilderWidget +%End + +%TypeHeaderCode +#include "qgsexpressionbuilderdialog.h" +%End + public: + QgsExpressionBuilderDialog( QgsVectorLayer *layer, + const QString &startText = QString(), + QWidget *parent /TransferThis/ = 0, + const QString &key = "generic", + const QgsExpressionContext &context = QgsExpressionContext() ); + + QgsExpressionBuilderWidget *expressionBuilder(); +%Docstring +The builder widget that is used by the dialog +%End + + void setExpressionText( const QString &text ); + + QString expressionText(); + + QgsExpressionContext expressionContext() const; +%Docstring +Returns the expression context for the dialog. The context is used for the expression +preview result and for populating the list of available functions and variables. + +.. seealso:: :py:func:`setExpressionContext` + +.. versionadded:: 2.12 +%End + + void setExpressionContext( const QgsExpressionContext &context ); +%Docstring +Sets the expression context for the dialog. The context is used for the expression +preview result and for populating the list of available functions and variables. + +:param context: expression context + +.. seealso:: :py:func:`expressionContext` + +.. versionadded:: 2.12 +%End + + void setGeomCalculator( const QgsDistanceArea &da ); +%Docstring +Sets geometry calculator used in distance/area calculations. +%End + + bool allowEvalErrors() const; +%Docstring +Allow accepting invalid expressions. This can be useful when we are not able to +provide an expression context of which we are sure it's completely populated. + +.. versionadded:: 3.0 +%End + + void setAllowEvalErrors( bool allowEvalErrors ); +%Docstring +Allow accepting expressions with evaluation errors. This can be useful when we are not able to +provide an expression context of which we are sure it's completely populated. + +.. versionadded:: 3.0 +%End + + signals: + + void allowEvalErrorsChanged(); +%Docstring +Allow accepting expressions with evaluation errors. This can be useful when we are not able to +provide an expression context of which we are sure it's completely populated. + +.. versionadded:: 3.0 +%End + + protected: + + virtual void done( int r ); + +%Docstring +Is called when the dialog get accepted or rejected +Used to save geometry + +:param r: result value (unused) +%End + + virtual void accept(); + + +}; + + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsexpressionbuilderdialog.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/gui/qgsexpressionbuilderwidget.sip.in b/python/gui/qgsexpressionbuilderwidget.sip.in new file mode 100644 index 00000000000..d2d14e971dd --- /dev/null +++ b/python/gui/qgsexpressionbuilderwidget.sip.in @@ -0,0 +1,341 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsexpressionbuilderwidget.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + +class QgsExpressionItem : QStandardItem +{ +%Docstring +An expression item that can be used in the QgsExpressionBuilderWidget tree. +%End + +%TypeHeaderCode +#include "qgsexpressionbuilderwidget.h" +%End + public: + enum ItemType + { + Header, + Field, + ExpressionNode + }; + + QgsExpressionItem( const QString &label, + const QString &expressionText, + const QString &helpText, + QgsExpressionItem::ItemType itemType = ExpressionNode ); + + QgsExpressionItem( const QString &label, + const QString &expressionText, + QgsExpressionItem::ItemType itemType = ExpressionNode ); + + QString getExpressionText() const; + + QString getHelpText() const; +%Docstring +Get the help text that is associated with this expression item. + +:return: The help text. +%End + + void setHelpText( const QString &helpText ); +%Docstring +Set the help text for the current item + +.. note:: + + The help text can be set as a html string. +%End + + QgsExpressionItem::ItemType getItemType() const; +%Docstring +Get the type of expression item, e.g., header, field, ExpressionNode. + +:return: The QgsExpressionItem.ItemType +%End + + static const int CUSTOM_SORT_ROLE; + static const int ITEM_TYPE_ROLE; + +}; + +class QgsExpressionItemSearchProxy : QSortFilterProxyModel +{ +%Docstring +Search proxy used to filter the QgsExpressionBuilderWidget tree. +The default search for a tree model only searches top level this will handle one +level down +%End + +%TypeHeaderCode +#include "qgsexpressionbuilderwidget.h" +%End + public: + QgsExpressionItemSearchProxy(); + + virtual bool filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const; + + + protected: + + virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const; + +}; + + +class QgsExpressionBuilderWidget : QWidget +{ +%Docstring +A reusable widget that can be used to build a expression string. +See QgsExpressionBuilderDialog for example of usage. +%End + +%TypeHeaderCode +#include "qgsexpressionbuilderwidget.h" +%End + public: + + QgsExpressionBuilderWidget( QWidget *parent /TransferThis/ = 0 ); +%Docstring +Create a new expression builder widget with an optional parent. +%End + ~QgsExpressionBuilderWidget(); + + void setLayer( QgsVectorLayer *layer ); +%Docstring +Sets layer in order to get the fields and values + +.. note:: + + this needs to be called before calling loadFieldNames(). +%End + + void loadFieldNames(); +%Docstring +Loads all the field names from the layer. +@remarks Should this really be public couldn't we just do this for the user? +%End + + void loadFieldNames( const QgsFields &fields ); + + void loadFieldsAndValues( const QMap &fieldValues ); +%Docstring +Loads field names and values from the specified map. + +.. note:: + + The field values must be quoted appropriately if they are strings. + +.. versionadded:: 2.12 +%End + + void setGeomCalculator( const QgsDistanceArea &da ); +%Docstring +Sets geometry calculator used in distance/area calculations. +%End + + QString expressionText(); +%Docstring +Gets the expression string that has been set in the expression area. + +:return: The expression as a string. * +%End + + void setExpressionText( const QString &expression ); +%Docstring +Sets the expression string for the widget +%End + + QgsExpressionContext expressionContext() const; +%Docstring +Returns the expression context for the widget. The context is used for the expression +preview result and for populating the list of available functions and variables. + +.. seealso:: :py:func:`setExpressionContext` + +.. versionadded:: 2.12 +%End + + void setExpressionContext( const QgsExpressionContext &context ); +%Docstring +Sets the expression context for the widget. The context is used for the expression +preview result and for populating the list of available functions and variables. + +:param context: expression context + +.. seealso:: :py:func:`expressionContext` + +.. versionadded:: 2.12 +%End + + void registerItem( const QString &group, const QString &label, const QString &expressionText, + const QString &helpText = QString(), + QgsExpressionItem::ItemType type = QgsExpressionItem::ExpressionNode, + bool highlightedItem = false, int sortOrder = 1 ); +%Docstring +Registers a node item for the expression builder. + +:param group: The group the item will be show in the tree view. If the group doesn't exsit it will be created. +:param label: The label that is show to the user for the item in the tree. +:param expressionText: The text that is inserted into the expression area when the user double clicks on the item. +:param helpText: The help text that the user will see when item is selected. +:param type: The type of the expression item. +:param highlightedItem: set to true to make the item highlighted, which inserts a bold copy of the item at the top level +:param sortOrder: sort ranking for item +%End + + bool isExpressionValid(); + + void saveToRecent( const QString &collection = "generic" ); +%Docstring +Adds the current expression to the given collection. +By default it is saved to the collection "generic". +%End + + void loadRecent( const QString &collection = "generic" ); +%Docstring +Loads the recent expressions from the given collection. +By default it is loaded from the collection "generic". +%End + + void newFunctionFile( const QString &fileName = "scratch" ); +%Docstring +Create a new file in the function editor +%End + + void saveFunctionFile( QString fileName ); +%Docstring +Save the current function editor text to the given file. +%End + + void loadCodeFromFile( QString path ); +%Docstring +Load code from the given file into the function editor +%End + + void loadFunctionCode( const QString &code ); +%Docstring +Load code into the function editor +%End + + void updateFunctionFileList( const QString &path ); +%Docstring +Update the list of function files found at the given path +%End + + QStandardItemModel *model(); +%Docstring +Returns a pointer to the dialog's function item model. +This method is exposed for testing purposes only - it should not be used to modify the model. + +.. versionadded:: 3.0 +%End + + QgsProject *project(); +%Docstring +Returns the project currently associated with the widget. + +.. seealso:: :py:func:`setProject` + +.. versionadded:: 3.0 +%End + + void setProject( QgsProject *project ); +%Docstring +Sets the ``project`` currently associated with the widget. This +controls which layers and relations and other project-specific items are shown in the widget. + +.. seealso:: :py:func:`project` + +.. versionadded:: 3.0 +%End + + bool evalError() const; +%Docstring +Will be set to true if the current expression text reported an eval error +with the context. + +.. versionadded:: 3.0 +%End + + bool parserError() const; +%Docstring +Will be set to true if the current expression text reports a parser error +with the context. + +.. versionadded:: 3.0 +%End + + public slots: + + void loadSampleValues(); +%Docstring +Load sample values into the sample value area +%End + + void loadAllValues(); +%Docstring +Load all unique values from the set layer into the sample area +%End + + void autosave(); +%Docstring +Auto save the current Python function code. +%End + + void setAutoSave( bool enabled ); +%Docstring +Enabled or disable auto saving. When enabled Python scripts will be auto saved +when text changes. + +:param enabled: True to enable auto saving. +%End + + signals: + + void expressionParsed( bool isValid ); +%Docstring +Emitted when the user changes the expression in the widget. +Users of this widget should connect to this signal to decide if to let the user +continue. + +:param isValid: Is true if the expression the user has typed is valid. +%End + + void evalErrorChanged(); +%Docstring +Will be set to true if the current expression text reported an eval error +with the context. + +.. versionadded:: 3.0 +%End + + void parserErrorChanged(); +%Docstring +Will be set to true if the current expression text reported a parser error +with the context. + +.. versionadded:: 3.0 +%End + + protected: + virtual void showEvent( QShowEvent *e ); + + +}; + + +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsexpressionbuilderwidget.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/gui/qgsquerybuilder.sip.in b/python/gui/qgsquerybuilder.sip.in new file mode 100644 index 00000000000..86b0fdac322 --- /dev/null +++ b/python/gui/qgsquerybuilder.sip.in @@ -0,0 +1,70 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsquerybuilder.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + +class QgsQueryBuilder : QDialog +{ +%Docstring + Query Builder for layers. + +The query builder allows interactive creation of a SQL for limiting the +features displayed in a vector layer. The fields in the table are +displayed and sample values (or all values) can be viewed to aid in +constructing the query. A test function returns the number of features that +will be returned. +%End + +%TypeHeaderCode +#include "qgsquerybuilder.h" +%End + public: + + QgsQueryBuilder( QgsVectorLayer *layer, QWidget *parent /TransferThis/ = 0, + Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags ); +%Docstring +This constructor is used when the query builder is called from the +vector layer properties dialog + +:param layer: existing vector layer +:param parent: Parent widget +:param fl: dialog flags +%End + + ~QgsQueryBuilder(); + + virtual void showEvent( QShowEvent *event ); + + + QString sql(); + void setSql( const QString &sqlStatement ); + + public slots: + virtual void accept(); + + virtual void reject(); + + void clear(); + + void test(); +%Docstring +Test the constructed sql statement to see if the vector layer data provider likes it. +The number of rows that would be returned is displayed in a message box. +The test uses a "select count(*) from ..." query to test the SQL +statement. +%End + + void setDatasourceDescription( const QString &uri ); + +}; +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgsquerybuilder.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ diff --git a/python/gui/qgssearchquerybuilder.sip.in b/python/gui/qgssearchquerybuilder.sip.in new file mode 100644 index 00000000000..1ba1ede6f7b --- /dev/null +++ b/python/gui/qgssearchquerybuilder.sip.in @@ -0,0 +1,52 @@ +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgssearchquerybuilder.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/ + + + + + +class QgsSearchQueryBuilder : QDialog +{ +%Docstring + Query Builder for search strings +%End + +%TypeHeaderCode +#include "qgssearchquerybuilder.h" +%End + public: + QgsSearchQueryBuilder( QgsVectorLayer *layer, + QWidget *parent /TransferThis/ = 0, + Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags ); +%Docstring +Constructor - takes pointer to vector layer as a parameter +%End + + QString searchString(); +%Docstring +returns newly created search string +%End + + void setSearchString( const QString &searchString ); +%Docstring +change search string shown in text field +%End + + public slots: + + void saveQuery(); + void loadQuery(); + +}; +/************************************************************************ + * This file has been generated automatically from * + * * + * src/gui/qgssearchquerybuilder.h * + * * + * Do not edit manually ! Edit header and run scripts/sipify.pl again * + ************************************************************************/