@@ -296,7 +296,7 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
296
296
.. seealso:: sizeWithUnits()
297
297
%End
298
298
299
- virtual void attemptMove( const QgsLayoutPoint &point, bool useReferencePoint = true, bool includesFrame = false );
299
+ virtual void attemptMove( const QgsLayoutPoint &point, bool useReferencePoint = true, bool includesFrame = false, int page = -1 );
300
300
%Docstring
301
301
Attempts to move the item to a specified ``point``.
302
302
@@ -310,6 +310,10 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
310
310
If ``includesFrame`` is true, then the position specified by ``point`` represents the
311
311
point at which to place the outside of the item's frame.
312
312
313
+ If ``page`` is not left at the default -1 value, then the position specified by ``point``
314
+ refers to the relative position on the corresponding layout ``page`` (where a ``page``
315
+ of 0 represents the first page).
316
+
313
317
Note that the final position of the item may not match the specified target position,
314
318
as data defined item position may override the specified value.
315
319
@@ -318,7 +322,6 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
318
322
.. seealso:: positionWithUnits()
319
323
%End
320
324
321
-
322
325
void attemptSetSceneRect( const QRectF &rect, bool includesFrame = false );
323
326
%Docstring
324
327
Attempts to update the item's position and size to match the passed ``rect`` in layout
@@ -347,6 +350,29 @@ class QgsLayoutItem : QgsLayoutObject, QGraphicsRectItem, QgsLayoutUndoObjectInt
347
350
:rtype: QgsLayoutPoint
348
351
%End
349
352
353
+ int page() const;
354
+ %Docstring
355
+ Returns the page the item is currently on, with the first page returning 0.
356
+ .. seealso:: pagePos()
357
+ :rtype: int
358
+ %End
359
+
360
+ QPointF pagePos() const;
361
+ %Docstring
362
+ Returns the item's position (in layout units) relative to the top left corner of its current page.
363
+ .. seealso:: page()
364
+ .. seealso:: pagePositionWithUnits()
365
+ :rtype: QPointF
366
+ %End
367
+
368
+ QgsLayoutPoint pagePositionWithUnits() const;
369
+ %Docstring
370
+ Returns the item's position (in item units) relative to the top left corner of its current page.
371
+ .. seealso:: page()
372
+ .. seealso:: pagePos()
373
+ :rtype: QgsLayoutPoint
374
+ %End
375
+
350
376
QgsLayoutSize sizeWithUnits() const;
351
377
%Docstring
352
378
Returns the item's current size, including units.
0 commit comments