2017-12-19 14:31:00 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutatlas.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-19 16:50:12 +10:00
|
|
|
class QgsLayoutAtlas : QObject, QgsAbstractLayoutIterator, QgsLayoutSerializableObject
|
2017-12-19 14:31:00 +10:00
|
|
|
{
|
|
|
|
%Docstring
|
2018-05-23 06:55:20 +10:00
|
|
|
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-05-23 06:55:20 +10:00
|
|
|
QgsLayoutAtlas implement the QgsAbstractLayoutIterator interface, allowing them to be used
|
|
|
|
directly with QgsLayoutExporter to automatically output all pages from the atlas.
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-05-23 06:55:20 +10:00
|
|
|
For QgsPrintLayout layouts, it is not necessary to manually construct a
|
|
|
|
QgsLayoutAtlas object. Instead, the atlas attached to the print layout
|
|
|
|
should be used. This can be retrieved by calling :py:func:`QgsPrintLayout.atlas()`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslayoutatlas.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-12-19 14:53:11 +10:00
|
|
|
QgsLayoutAtlas( QgsLayout *layout /TransferThis/ );
|
2017-12-19 14:31:00 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for new QgsLayoutAtlas.
|
|
|
|
%End
|
|
|
|
|
2017-12-19 15:31:15 +10:00
|
|
|
virtual QString stringType() const;
|
|
|
|
|
|
|
|
virtual QgsLayout *layout();
|
|
|
|
|
2017-12-20 17:37:10 +10:00
|
|
|
|
|
|
|
|
2017-12-19 15:31:15 +10:00
|
|
|
virtual bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
|
|
|
|
|
|
|
|
virtual bool readXml( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context );
|
|
|
|
|
|
|
|
|
2017-12-19 14:31:00 +10:00
|
|
|
bool enabled() const;
|
|
|
|
%Docstring
|
|
|
|
Returns whether the atlas generation is enabled
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setEnabled`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setEnabled( bool enabled );
|
|
|
|
%Docstring
|
|
|
|
Sets whether the atlas is ``enabled``.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`enabled`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool hideCoverage() const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if the atlas is set to hide the coverage layer.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setHideCoverage`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setHideCoverage( bool hide );
|
|
|
|
%Docstring
|
|
|
|
Sets whether the coverage layer should be hidden in map items in the layouts.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`hideCoverage`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString filenameExpression() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the filename expression used for generating output filenames for each
|
|
|
|
atlas page.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFilenameExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`currentFilename`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
2017-12-19 15:31:15 +10:00
|
|
|
bool setFilenameExpression( const QString &expression, QString &errorString /Out/ );
|
2017-12-19 14:31:00 +10:00
|
|
|
%Docstring
|
|
|
|
Sets the filename ``expression`` used for generating output filenames for each
|
|
|
|
atlas page.
|
|
|
|
If an invalid expression is passed, false will be returned and ``errorString``
|
|
|
|
will be set to the expression error.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`filenameExpression`
|
2017-12-20 08:17:45 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`currentFilename`
|
2017-12-20 08:17:45 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString currentFilename() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the current feature filename.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`filenameExpression`
|
2017-12-20 08:17:45 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFilenameExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsVectorLayer *coverageLayer() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the coverage layer used for the atlas features.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setCoverageLayer`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setCoverageLayer( QgsVectorLayer *layer );
|
|
|
|
%Docstring
|
|
|
|
Sets the coverage ``layer`` to use for the atlas features.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`coverageLayer`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString pageNameExpression() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the expression (or field name) used for calculating the page name.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setPageNameExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`nameForPage`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setPageNameExpression( const QString &expression );
|
|
|
|
%Docstring
|
|
|
|
Sets the ``expression`` (or field name) used for calculating the page name.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`pageNameExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString nameForPage( int page ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the calculated name for a specified atlas ``page`` number. Page numbers start at 0.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`pageNameExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool sortFeatures() const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if features should be sorted in the atlas.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortAscending`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setSortFeatures( bool enabled );
|
|
|
|
%Docstring
|
|
|
|
Sets whether features should be sorted in the atlas.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortAscending`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool sortAscending() const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if features should be sorted in an ascending order.
|
|
|
|
|
|
|
|
This property has no effect is sortFeatures() is false.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortAscending`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setSortAscending( bool ascending );
|
|
|
|
%Docstring
|
|
|
|
Sets whether features should be sorted in an ascending order.
|
|
|
|
|
|
|
|
This property has no effect is sortFeatures() is false.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortAscending`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString sortExpression() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the expression (or field name) to use for sorting features.
|
|
|
|
|
|
|
|
This property has no effect is sortFeatures() is false.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortAscending`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setSortExpression( const QString &expression );
|
|
|
|
%Docstring
|
|
|
|
Sets the ``expression`` (or field name) to use for sorting features.
|
|
|
|
|
|
|
|
This property has no effect is sortFeatures() is false.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSortAscending`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sortExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool filterFeatures() const;
|
|
|
|
%Docstring
|
|
|
|
Returns true if features should be filtered in the coverage layer.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`filterExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFilterExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setFilterFeatures( bool filtered );
|
|
|
|
%Docstring
|
|
|
|
Sets whether features should be ``filtered`` in the coverage layer.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`filterFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFilterExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString filterExpression() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the expression used for filtering features in the coverage layer.
|
|
|
|
|
|
|
|
This property has no effect is filterFeatures() is false.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFilterExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`filterFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
2017-12-19 15:31:15 +10:00
|
|
|
bool setFilterExpression( const QString &expression, QString &errorString /Out/ );
|
2017-12-19 14:31:00 +10:00
|
|
|
%Docstring
|
|
|
|
Sets the ``expression`` used for filtering features in the coverage layer.
|
|
|
|
|
|
|
|
This property has no effect is filterFeatures() is false.
|
|
|
|
|
|
|
|
If an invalid expression is passed, false will be returned and ``errorString``
|
|
|
|
will be set to the expression error.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`filterExpression`
|
2017-12-19 14:31:00 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setFilterFeatures`
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
2017-12-19 16:50:12 +10:00
|
|
|
int updateFeatures();
|
|
|
|
%Docstring
|
|
|
|
Requeries the current atlas coverage layer and applies filtering and sorting. Returns
|
|
|
|
number of matching features.
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool beginRender();
|
|
|
|
|
|
|
|
virtual bool endRender();
|
|
|
|
|
2017-12-29 09:39:03 +10:00
|
|
|
virtual int count();
|
2017-12-19 16:50:12 +10:00
|
|
|
|
2017-12-23 19:09:05 +10:00
|
|
|
virtual QString filePath( const QString &baseFilePath, const QString &extension );
|
|
|
|
|
2017-12-19 16:50:12 +10:00
|
|
|
|
2017-12-19 19:58:37 +10:00
|
|
|
int currentFeatureNumber() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the current feature number, where a value of 0 corresponds to the first feature.
|
|
|
|
%End
|
|
|
|
|
2017-12-19 14:31:00 +10:00
|
|
|
public slots:
|
|
|
|
|
2017-12-19 16:50:12 +10:00
|
|
|
virtual bool next();
|
|
|
|
|
|
|
|
|
2017-12-23 17:51:47 +10:00
|
|
|
bool previous();
|
|
|
|
%Docstring
|
|
|
|
Iterates to the previous feature, returning false if no previous feature exists.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`next`
|
2017-12-23 17:51:47 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`last`
|
2017-12-23 17:51:47 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`first`
|
2017-12-31 14:53:14 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`seekTo`
|
2017-12-23 17:51:47 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool last();
|
|
|
|
%Docstring
|
|
|
|
Seeks to the last feature, returning false if no feature was found.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`next`
|
2017-12-19 16:50:12 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`previous`
|
2017-12-23 17:51:47 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`first`
|
2017-12-31 14:53:14 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`seekTo`
|
2017-12-23 17:51:47 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool first();
|
|
|
|
%Docstring
|
|
|
|
Seeks to the first feature, returning false if no feature was found.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`next`
|
2017-12-23 17:51:47 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`previous`
|
2017-12-23 17:51:47 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`last`
|
2017-12-31 14:53:14 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`seekTo`
|
2017-12-23 17:51:47 +10:00
|
|
|
%End
|
2017-12-19 16:50:12 +10:00
|
|
|
|
2017-12-19 19:58:37 +10:00
|
|
|
bool seekTo( int feature );
|
2017-12-31 14:53:14 +10:00
|
|
|
%Docstring
|
|
|
|
Seeks to the specified ``feature`` number.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`first`
|
2017-12-31 14:53:14 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`previous`
|
2017-12-31 14:53:14 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`next`
|
2017-12-31 14:53:14 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`last`
|
2018-01-01 19:04:58 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool seekTo( const QgsFeature &feature );
|
|
|
|
%Docstring
|
|
|
|
Seeks to the specified ``feature``.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`first`
|
2018-01-01 19:04:58 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`previous`
|
2018-01-01 19:04:58 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`next`
|
2018-01-01 19:04:58 +10:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`last`
|
2017-12-31 14:53:14 +10:00
|
|
|
%End
|
2017-12-19 19:58:37 +10:00
|
|
|
|
|
|
|
void refreshCurrentFeature();
|
|
|
|
%Docstring
|
|
|
|
Refreshes the current atlas feature, by refetching its attributes from the vector layer provider
|
|
|
|
%End
|
2017-12-19 16:50:12 +10:00
|
|
|
|
2017-12-19 14:31:00 +10:00
|
|
|
signals:
|
|
|
|
|
|
|
|
void changed();
|
|
|
|
%Docstring
|
|
|
|
Emitted when one of the atlas parameters changes.
|
|
|
|
%End
|
|
|
|
|
|
|
|
void toggled( bool );
|
|
|
|
%Docstring
|
|
|
|
Emitted when atlas is enabled or disabled.
|
|
|
|
%End
|
|
|
|
|
|
|
|
void coverageLayerChanged( QgsVectorLayer *layer );
|
|
|
|
%Docstring
|
|
|
|
Emitted when the coverage layer for the atlas changes.
|
2017-12-19 16:50:12 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void messagePushed( const QString &message );
|
|
|
|
%Docstring
|
2019-02-25 19:18:29 +10:00
|
|
|
Emitted when the atlas has an updated status bar ``message``.
|
2017-12-19 16:50:12 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void numberFeaturesChanged( int numFeatures );
|
|
|
|
%Docstring
|
|
|
|
Emitted when the number of features for the atlas changes.
|
2017-12-19 19:58:37 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void featureChanged( const QgsFeature &feature );
|
|
|
|
%Docstring
|
2019-02-25 19:18:29 +10:00
|
|
|
Emitted when the current atlas ``feature`` changes.
|
2017-12-19 16:50:12 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void renderBegun();
|
|
|
|
%Docstring
|
|
|
|
Emitted when atlas rendering has begun.
|
|
|
|
%End
|
|
|
|
|
|
|
|
void renderEnded();
|
|
|
|
%Docstring
|
|
|
|
Emitted when atlas rendering has ended.
|
2017-12-19 14:31:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutatlas.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|