Skip to content

Commit b74a0ef

Browse files
committedDec 6, 2017
Work on layout and layout item serialization and restoration
1 parent ca75e8c commit b74a0ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+396
-196
lines changed
 

‎python/core/layout/qgslayout.sip

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,23 @@ class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator, QgsLayoutUndoOb
424424
:rtype: bool
425425
%End
426426

427+
QVector< QgsLayoutItem * > addItemsFromXml( const QDomElement &parentElement, const QDomDocument &document,
428+
const QgsReadWriteContext &context,
429+
QPointF *position = 0, bool pasteInPlace = false );
430+
%Docstring
431+
Add items from an XML representation to the layout. Used for project file reading and pasting items from clipboard.
432+
433+
The ``position`` argument is optional, and if it is not specified the items will be restored to their
434+
original position from the XML serialization. If specified, the items will be positioned such that the top-left
435+
bounds of all added items is located at this ``position``.
436+
437+
The ``pasteInPlace`` argument determines whether the serialized position should be respected, but remapped to the
438+
origin of the page corresponding to the page at ``position``.
439+
440+
A list of the newly added items is returned.
441+
:rtype: list of QgsLayoutItem
442+
%End
443+
427444
QgsLayoutUndoStack *undoStack();
428445
%Docstring
429446
Returns a pointer to the layout's undo stack, which manages undo/redo states for the layout

‎python/core/layout/qgslayoutframe.sip

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ class QgsLayoutFrame: QgsLayoutItem
3535

3636
virtual int type() const;
3737

38-
virtual QString stringType() const;
39-
4038
virtual QString uuid() const;
4139

4240

0 commit comments

Comments
 (0)
Please sign in to comment.