QGIS API Documentation
3.22.4-Białowieża (ce8e65e95e)
|
An interface for layout objects which can be stored and read from DOM elements. More...
#include <qgslayoutserializableobject.h>
Public Member Functions | |
QgsAbstractLayoutUndoCommand * | createCommand (const QString &text, int id, QUndoCommand *parent=nullptr) override |
Creates a new layout undo command with the specified text and parent. More... | |
virtual QgsLayout * | layout ()=0 |
Returns the layout the object belongs to. More... | |
virtual bool | readXml (const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0 |
Sets the objects's state from a DOM element. More... | |
virtual QString | stringType () const =0 |
Returns the object type as a string. More... | |
virtual bool | writeXml (QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0 |
Stores the objects's state in a DOM element. More... | |
Public Member Functions inherited from QgsLayoutUndoObjectInterface | |
virtual | ~QgsLayoutUndoObjectInterface ()=default |
Destructor for QgsLayoutUndoObjectInterface. More... | |
Friends | |
class | QgsLayoutSerializableObjectUndoCommand |
An interface for layout objects which can be stored and read from DOM elements.
Definition at line 35 of file qgslayoutserializableobject.h.
|
overridevirtual |
Creates a new layout undo command with the specified text and parent.
The id argument can be used to specify an id number for the source event - this is used to determine whether QUndoCommand command compression can apply to the command.
Implements QgsLayoutUndoObjectInterface.
Definition at line 78 of file qgslayoutserializableobject.cpp.
|
pure virtual |
Returns the layout the object belongs to.
Implemented in QgsLayoutSnapper, QgsLayoutPageCollection, QgsLayoutGuideCollection, QgsLayoutGridSettings, and QgsLayoutAtlas.
|
pure virtual |
Sets the objects's state from a DOM element.
element is the DOM node corresponding to the object.
Implemented in QgsLayoutSnapper, QgsLayoutGridSettings, QgsLayoutAtlas, QgsLayoutPageCollection, and QgsLayoutGuideCollection.
|
pure virtual |
Returns the object type as a string.
This string must be a unique, single word, character only representation of the item type, eg "LayoutScaleBar"
Implemented in QgsLayoutSnapper, QgsLayoutPageCollection, QgsLayoutGuideCollection, QgsLayoutGridSettings, and QgsLayoutAtlas.
|
pure virtual |
Stores the objects's state in a DOM element.
The parentElement should refer to the parent layout's DOM element.
Implemented in QgsLayoutSnapper, QgsLayoutPageCollection, QgsLayoutGuideCollection, QgsLayoutGridSettings, and QgsLayoutAtlas.
|
friend |
Definition at line 67 of file qgslayoutserializableobject.h.