Base class for commands to undo/redo layout and layout object changes.
More...
#include <qgslayoutundocommand.h>
|
virtual void | restoreState (QDomDocument &stateDoc)=0 |
| Restores the state of the object from the specified stateDoc. More...
|
|
virtual void | saveState (QDomDocument &stateDoc) const =0 |
| Saves the state of the object to the specified stateDoc. More...
|
|
void | setAfterState (const QDomDocument &stateDoc) |
| Manually sets the after state for the command. More...
|
|
Base class for commands to undo/redo layout and layout object changes.
- Since
- QGIS 3.0
Definition at line 34 of file qgslayoutundocommand.h.
◆ QgsAbstractLayoutUndoCommand()
QgsAbstractLayoutUndoCommand::QgsAbstractLayoutUndoCommand |
( |
const QString & |
text, |
|
|
int |
id = 0 , |
|
|
QUndoCommand * |
parent = nullptr |
|
) |
| |
Constructor for QgsLayoutUndoCommand.
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.
Definition at line 21 of file qgslayoutundocommand.cpp.
◆ afterState()
QDomDocument QgsAbstractLayoutUndoCommand::afterState |
( |
| ) |
const |
|
inline |
◆ beforeState()
QDomDocument QgsAbstractLayoutUndoCommand::beforeState |
( |
| ) |
const |
|
inline |
◆ containsChange()
bool QgsAbstractLayoutUndoCommand::containsChange |
( |
| ) |
const |
|
virtual |
◆ id()
int QgsAbstractLayoutUndoCommand::id |
( |
| ) |
const |
|
inlineoverride |
◆ redo()
void QgsAbstractLayoutUndoCommand::redo |
( |
| ) |
|
|
override |
◆ restoreState()
virtual void QgsAbstractLayoutUndoCommand::restoreState |
( |
QDomDocument & |
stateDoc | ) |
|
|
protectedpure virtual |
Restores the state of the object from the specified stateDoc.
Subclasses must implement this to handle restoring their current state from the encapsulated state.
- See also
- saveState()
◆ saveAfterState()
void QgsAbstractLayoutUndoCommand::saveAfterState |
( |
| ) |
|
◆ saveBeforeState()
void QgsAbstractLayoutUndoCommand::saveBeforeState |
( |
| ) |
|
◆ saveState()
virtual void QgsAbstractLayoutUndoCommand::saveState |
( |
QDomDocument & |
stateDoc | ) |
const |
|
protectedpure virtual |
Saves the state of the object to the specified stateDoc.
Subclasses must implement this to handle encapsulating their current state into a DOM document.
- See also
- restoreState()
◆ setAfterState()
void QgsAbstractLayoutUndoCommand::setAfterState |
( |
const QDomDocument & |
stateDoc | ) |
|
|
protected |
Manually sets the after state for the command.
Generally this should not be called directly.
Definition at line 58 of file qgslayoutundocommand.cpp.
◆ undo()
void QgsAbstractLayoutUndoCommand::undo |
( |
| ) |
|
|
override |
◆ mFirstRun
bool QgsAbstractLayoutUndoCommand::mFirstRun = true |
|
protected |
The documentation for this class was generated from the following files: