Skip to content

Commit e312d02

Browse files
committedJan 5, 2018
Tighten QgsAbstractLayoutIterator interface
1 parent 69ddc32 commit e312d02

File tree

4 files changed

+56
-70
lines changed

4 files changed

+56
-70
lines changed
 

‎python/core/layout/qgsabstractlayoutiterator.sip

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -49,46 +49,8 @@ Returns the number of features to iterate over.
4949
virtual bool next() = 0;
5050
%Docstring
5151
Iterates to next feature, returning false if no more features exist to iterate over.
52-
53-
.. seealso:: :py:func:`previous()`
54-
55-
.. seealso:: :py:func:`last()`
56-
57-
.. seealso:: :py:func:`first()`
58-
%End
59-
60-
virtual bool previous() = 0;
61-
%Docstring
62-
Iterates to the previous feature, returning false if no previous feature exists.
63-
64-
.. seealso:: :py:func:`next()`
65-
66-
.. seealso:: :py:func:`last()`
67-
68-
.. seealso:: :py:func:`first()`
69-
%End
70-
71-
virtual bool last() = 0;
72-
%Docstring
73-
Seeks to the last feature, returning false if no feature was found.
74-
75-
.. seealso:: :py:func:`next()`
76-
77-
.. seealso:: :py:func:`previous()`
78-
79-
.. seealso:: :py:func:`first()`
8052
%End
8153

82-
virtual bool first() = 0;
83-
%Docstring
84-
Seeks to the first feature, returning false if no feature was found.
85-
86-
.. seealso:: :py:func:`next()`
87-
88-
.. seealso:: :py:func:`previous()`
89-
90-
.. seealso:: :py:func:`last()`
91-
%End
9254
};
9355

9456

‎python/core/layout/qgslayoutatlas.sip

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,39 @@ Returns the current feature number, where a value of 0 corresponds to the first
280280

281281
virtual bool next();
282282

283-
virtual bool previous();
284283

285-
virtual bool first();
284+
bool previous();
285+
%Docstring
286+
Iterates to the previous feature, returning false if no previous feature exists.
287+
288+
.. seealso:: :py:func:`next()`
289+
290+
.. seealso:: :py:func:`last()`
291+
292+
.. seealso:: :py:func:`first()`
293+
%End
294+
295+
bool last();
296+
%Docstring
297+
Seeks to the last feature, returning false if no feature was found.
298+
299+
.. seealso:: :py:func:`next()`
286300

287-
virtual bool last();
301+
.. seealso:: :py:func:`previous()`
302+
303+
.. seealso:: :py:func:`first()`
304+
%End
305+
306+
bool first();
307+
%Docstring
308+
Seeks to the first feature, returning false if no feature was found.
309+
310+
.. seealso:: :py:func:`next()`
311+
312+
.. seealso:: :py:func:`previous()`
313+
314+
.. seealso:: :py:func:`last()`
315+
%End
288316

289317
bool seekTo( int feature );
290318

‎src/core/layout/qgsabstractlayoutiterator.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,9 @@ class CORE_EXPORT QgsAbstractLayoutIterator
4545

4646
/**
4747
* Iterates to next feature, returning false if no more features exist to iterate over.
48-
* \see previous()
49-
* \see last()
50-
* \see first()
5148
*/
5249
virtual bool next() = 0;
5350

54-
/**
55-
* Iterates to the previous feature, returning false if no previous feature exists.
56-
* \see next()
57-
* \see last()
58-
* \see first()
59-
*/
60-
virtual bool previous() = 0;
61-
62-
/**
63-
* Seeks to the last feature, returning false if no feature was found.
64-
* \see next()
65-
* \see previous()
66-
* \see first()
67-
*/
68-
virtual bool last() = 0;
69-
70-
/**
71-
* Seeks to the first feature, returning false if no feature was found.
72-
* \see next()
73-
* \see previous()
74-
* \see last()
75-
*/
76-
virtual bool first() = 0;
7751
};
7852

7953
#endif //QGSABSTRACTLAYOUTITERATOR_H

‎src/core/layout/qgslayoutatlas.h

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,31 @@ class CORE_EXPORT QgsLayoutAtlas : public QObject, public QgsAbstractLayoutItera
251251
public slots:
252252

253253
bool next() override;
254-
bool previous() override;
255-
bool first() override;
256-
bool last() override;
254+
255+
/**
256+
* Iterates to the previous feature, returning false if no previous feature exists.
257+
* \see next()
258+
* \see last()
259+
* \see first()
260+
*/
261+
bool previous();
262+
263+
/**
264+
* Seeks to the last feature, returning false if no feature was found.
265+
* \see next()
266+
* \see previous()
267+
* \see first()
268+
*/
269+
bool last();
270+
271+
/**
272+
* Seeks to the first feature, returning false if no feature was found.
273+
* \see next()
274+
* \see previous()
275+
* \see last()
276+
*/
277+
bool first();
278+
257279
bool seekTo( int feature );
258280

259281
/**

0 commit comments

Comments
 (0)
Please sign in to comment.