2017-05-14 09:48:41 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsexpressionfieldbuffer.h *
|
|
|
|
* *
|
2024-08-11 07:55:04 +10:00
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
2017-05-14 09:48:41 +02:00
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-11 19:16:55 +02:00
|
|
|
class QgsExpressionFieldBuffer
|
|
|
|
{
|
2021-03-22 21:13:52 +01:00
|
|
|
%Docstring(signature="appended")
|
2017-12-15 10:36:55 -04:00
|
|
|
Buffers information about expression fields for a vector layer.
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
|
|
|
|
2015-06-11 19:16:55 +02:00
|
|
|
%TypeHeaderCode
|
2017-05-14 09:48:41 +02:00
|
|
|
#include "qgsexpressionfieldbuffer.h"
|
2015-06-11 19:16:55 +02:00
|
|
|
%End
|
|
|
|
public:
|
2017-05-14 09:48:41 +02:00
|
|
|
struct ExpressionField
|
2015-06-11 19:16:55 +02:00
|
|
|
{
|
2017-05-01 16:42:33 +02:00
|
|
|
ExpressionField( const QString &exp, const QgsField &fld );
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
QgsExpression cachedExpression;
|
|
|
|
QgsField field;
|
2015-06-11 19:16:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
QgsExpressionFieldBuffer();
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void addExpression( const QString &exp, const QgsField &fld );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Add an expression to the buffer
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param exp: expression to add
|
|
|
|
:param fld: field to add
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2015-06-11 19:16:55 +02:00
|
|
|
|
|
|
|
void removeExpression( int index );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Remove an expression from the buffer
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param index: index of expression to remove
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2015-06-11 19:16:55 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void renameExpression( int index, const QString &name );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Renames an expression field at a given index
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param index: The index of the expression to change
|
2018-05-27 16:42:41 +10:00
|
|
|
:param name: New name for field
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2016-10-09 08:56:50 +10:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void updateExpression( int index, const QString &exp );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Changes the expression at a given index
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param index: The index of the expression to change
|
2018-05-27 16:42:41 +10:00
|
|
|
:param exp: The new expression to set
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2015-06-11 19:16:55 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void writeXml( QDomNode &layer_node, QDomDocument &document ) const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Saves expressions to xml under the layer node
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2015-06-11 19:16:55 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
void readXml( const QDomNode &layer_node );
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Reads expressions from project file
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
2015-06-11 19:16:55 +02:00
|
|
|
|
2022-04-27 15:19:09 +02:00
|
|
|
void updateFields( QgsFields &flds ) const;
|
2017-05-14 09:48:41 +02:00
|
|
|
%Docstring
|
2021-01-30 09:16:35 +10:00
|
|
|
Adds fields with the expressions buffered in this object to a :py:class:`QgsFields` object
|
2017-05-14 09:48:41 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param flds: The fields to be updated
|
2017-05-14 09:48:41 +02:00
|
|
|
%End
|
|
|
|
|
2017-05-14 10:50:30 +02:00
|
|
|
QList<QgsExpressionFieldBuffer::ExpressionField> expressions() const;
|
2015-06-11 19:16:55 +02:00
|
|
|
|
|
|
|
};
|
2017-05-14 09:48:41 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsexpressionfieldbuffer.h *
|
|
|
|
* *
|
2024-08-11 07:55:04 +10:00
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
2017-05-14 09:48:41 +02:00
|
|
|
************************************************************************/
|