Skip to content
Permalink
Browse files

Tighten QgsAbstractLayoutIterator interface

  • Loading branch information
nyalldawson committed Dec 23, 2017
1 parent 69ddc32 commit e312d02c2bcba989b9e2844a7e1cdf0796b12d6f
@@ -49,46 +49,8 @@ Returns the number of features to iterate over.
virtual bool next() = 0;
%Docstring
Iterates to next feature, returning false if no more features exist to iterate over.

.. seealso:: :py:func:`previous()`

.. seealso:: :py:func:`last()`

.. seealso:: :py:func:`first()`
%End

virtual bool previous() = 0;
%Docstring
Iterates to the previous feature, returning false if no previous feature exists.

.. seealso:: :py:func:`next()`

.. seealso:: :py:func:`last()`

.. seealso:: :py:func:`first()`
%End

virtual bool last() = 0;
%Docstring
Seeks to the last feature, returning false if no feature was found.

.. seealso:: :py:func:`next()`

.. seealso:: :py:func:`previous()`

.. seealso:: :py:func:`first()`
%End

virtual bool first() = 0;
%Docstring
Seeks to the first feature, returning false if no feature was found.

.. seealso:: :py:func:`next()`

.. seealso:: :py:func:`previous()`

.. seealso:: :py:func:`last()`
%End
};


@@ -280,11 +280,39 @@ Returns the current feature number, where a value of 0 corresponds to the first

virtual bool next();

virtual bool previous();

virtual bool first();
bool previous();
%Docstring
Iterates to the previous feature, returning false if no previous feature exists.

.. seealso:: :py:func:`next()`

.. seealso:: :py:func:`last()`

.. seealso:: :py:func:`first()`
%End

bool last();
%Docstring
Seeks to the last feature, returning false if no feature was found.

.. seealso:: :py:func:`next()`

virtual bool last();
.. seealso:: :py:func:`previous()`

.. seealso:: :py:func:`first()`
%End

bool first();
%Docstring
Seeks to the first feature, returning false if no feature was found.

.. seealso:: :py:func:`next()`

.. seealso:: :py:func:`previous()`

.. seealso:: :py:func:`last()`
%End

bool seekTo( int feature );

@@ -45,35 +45,9 @@ class CORE_EXPORT QgsAbstractLayoutIterator

/**
* Iterates to next feature, returning false if no more features exist to iterate over.
* \see previous()
* \see last()
* \see first()
*/
virtual bool next() = 0;

/**
* Iterates to the previous feature, returning false if no previous feature exists.
* \see next()
* \see last()
* \see first()
*/
virtual bool previous() = 0;

/**
* Seeks to the last feature, returning false if no feature was found.
* \see next()
* \see previous()
* \see first()
*/
virtual bool last() = 0;

/**
* Seeks to the first feature, returning false if no feature was found.
* \see next()
* \see previous()
* \see last()
*/
virtual bool first() = 0;
};

#endif //QGSABSTRACTLAYOUTITERATOR_H
@@ -251,9 +251,31 @@ class CORE_EXPORT QgsLayoutAtlas : public QObject, public QgsAbstractLayoutItera
public slots:

bool next() override;
bool previous() override;
bool first() override;
bool last() override;

/**
* Iterates to the previous feature, returning false if no previous feature exists.
* \see next()
* \see last()
* \see first()
*/
bool previous();

/**
* Seeks to the last feature, returning false if no feature was found.
* \see next()
* \see previous()
* \see first()
*/
bool last();

/**
* Seeks to the first feature, returning false if no feature was found.
* \see next()
* \see previous()
* \see last()
*/
bool first();

bool seekTo( int feature );

/**

0 comments on commit e312d02

Please sign in to comment.
You can’t perform that action at this time.