22 : QUndoCommand( text, parent )
55 return !( mBeforeState.isNull() || mAfterState.isNull() || mBeforeState.toString() == mAfterState.toString() );
60 mAfterState = stateDoc;
bool mFirstRun
Flag to prevent the first redo() if the command is pushed to the undo stack.
virtual bool containsChange() const
Returns true if both the before and after states are valid and different.
virtual void saveState(QDomDocument &stateDoc) const =0
Saves the state of the object to the specified stateDoc.
void setAfterState(const QDomDocument &stateDoc)
Manually sets the after state for the command.
virtual void restoreState(QDomDocument &stateDoc)=0
Restores the state of the object from the specified stateDoc.
void saveAfterState()
Saves current layout state as after state.
QgsAbstractLayoutUndoCommand(const QString &text, int id=0, QUndoCommand *parent=nullptr)
Constructor for QgsLayoutUndoCommand.
void saveBeforeState()
Saves current layout state as before state.