33 bool mergeWith(
const QUndoCommand *command )
override
35 if ( command->id() == 0 )
38 const QgsLayoutSerializableObjectUndoCommand *
c =
dynamic_cast<const QgsLayoutSerializableObjectUndoCommand *
>( command );
44 if ( mObject->stringType() !=
c->mObject->stringType() )
47 setAfterState(
c->afterState() );
53 void saveState( QDomDocument &stateDoc )
const override
56 QDomElement documentElement = stateDoc.createElement( QStringLiteral(
"UndoState" ) );
58 stateDoc.appendChild( documentElement );
60 void restoreState( QDomDocument &stateDoc )
override
67 mObject->readXml( stateDoc.documentElement().firstChild().toElement(), stateDoc,
QgsReadWriteContext() );
68 mObject->layout()->project()->setDirty(
true );
Base class for commands to undo/redo layout and layout object changes.
An interface for layout objects which can be stored and read from DOM elements.
friend class QgsLayoutSerializableObjectUndoCommand
QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id, QUndoCommand *parent=nullptr) override
Creates a new layout undo command with the specified text and parent.
The class is used as a container of context for various read/write operations on other objects.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c