QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
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. | |
virtual QgsLayout * | layout ()=0 |
Returns the layout the object belongs to. | |
virtual bool | readXml (const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0 |
Sets the objects's state from a DOM element. | |
virtual QString | stringType () const =0 |
Returns the object type as a string. | |
virtual bool | writeXml (QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0 |
Stores the objects's state in a DOM element. | |
Public Member Functions inherited from QgsLayoutUndoObjectInterface | |
virtual | ~QgsLayoutUndoObjectInterface ()=default |
Friends | |
class | QgsLayoutSerializableObjectUndoCommand |
An interface for layout objects which can be stored and read from DOM elements.
Definition at line 34 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 QgsLayoutAtlas, QgsLayoutGridSettings, QgsLayoutGuideCollection, QgsLayoutPageCollection, and QgsLayoutSnapper.
|
pure virtual |
Sets the objects's state from a DOM element.
element is the DOM node corresponding to the object.
Implemented in QgsLayoutGuideCollection, QgsLayoutPageCollection, QgsLayoutAtlas, QgsLayoutGridSettings, and QgsLayoutSnapper.
|
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 QgsLayoutAtlas, QgsLayoutGridSettings, QgsLayoutGuideCollection, QgsLayoutPageCollection, and QgsLayoutSnapper.
|
pure virtual |
Stores the objects's state in a DOM element.
The parentElement should refer to the parent layout's DOM element.
Implemented in QgsLayoutAtlas, QgsLayoutGridSettings, QgsLayoutGuideCollection, QgsLayoutPageCollection, and QgsLayoutSnapper.
|
friend |
Definition at line 66 of file qgslayoutserializableobject.h.