8
8
9
9
10
10
11
- class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator
11
+ class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator, QgsLayoutUndoObjectInterface
12
12
{
13
13
%Docstring
14
14
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
@@ -39,8 +39,6 @@ class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator
39
39
called on the new layout.
40
40
%End
41
41
42
- ~QgsLayout();
43
-
44
42
void initializeDefaults();
45
43
%Docstring
46
44
Initializes an empty layout, e.g. by adding a default page to the layout. This should be called after creating
@@ -67,6 +65,14 @@ class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator
67
65
.. seealso:: name()
68
66
%End
69
67
68
+
69
+ QgsLayoutItem *itemByUuid( const QString &uuid );
70
+ %Docstring
71
+ Returns the layout item with matching ``uuid`` unique identifier, or a None
72
+ if a matching item could not be found.
73
+ :rtype: QgsLayoutItem
74
+ %End
75
+
70
76
void setUnits( QgsUnitTypes::LayoutUnit units );
71
77
%Docstring
72
78
Sets the native measurement ``units`` for the layout. These also form the default unit
@@ -247,6 +253,32 @@ class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator
247
253
method. Ownership of the item is transferred to the layout.
248
254
%End
249
255
256
+ QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;
257
+ %Docstring
258
+ Returns the layout's state encapsulated in a DOM element.
259
+ .. seealso:: readXml()
260
+ :rtype: QDomElement
261
+ %End
262
+
263
+ bool readXml( const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context );
264
+ %Docstring
265
+ Sets the collection's state from a DOM element. ``layoutElement`` is the DOM node corresponding to the layout.
266
+ .. seealso:: writeXml()
267
+ :rtype: bool
268
+ %End
269
+
270
+ QgsLayoutUndoStack *undoStack();
271
+ %Docstring
272
+ Returns a pointer to the layout's undo stack, which manages undo/redo states for the layout
273
+ and it's associated objects.
274
+ :rtype: QgsLayoutUndoStack
275
+ %End
276
+
277
+
278
+ virtual QgsAbstractLayoutUndoCommand *createCommand( const QString &text, int id = 0, QUndoCommand *parent = 0 ) /Factory/;
279
+
280
+
281
+
250
282
public slots:
251
283
252
284
void updateBounds();
0 commit comments