26 : QUndoCommand( text, parent )
106 QDomElement documentElement = stateDoc.createElement(
"ComposerItemState" );
107 source->
writeXML( documentElement, stateDoc );
108 stateDoc.appendChild( documentElement );
119 destItem->
readXML( stateDoc.documentElement().firstChild().toElement(), stateDoc );
147 if ( !c || thisItem != c->
item() )
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
QgsComposerMergeCommand(Context c, QgsComposerItem *item, const QString &text)
A item that forms part of a map composition.
void savePreviousState()
Saves current item state as previous state.
~QgsComposerMergeCommand()
void undo() override
Reverses the command.
void saveState(QDomDocument &stateDoc) const
void restoreState(QDomDocument &stateDoc) const
bool containsChange() const
Returns true if previous state and after state are valid and different.
int frameCount() const
Returns the number of frames associated with this multiframe.
virtual ~QgsComposerItemCommand()
Frame item for a composer multiframe item.
bool mergeWith(const QUndoCommand *command) override
void saveAfterState()
Saves current item state as after state.
bool mFirstRun
Flag to prevent the first redo() if the command is pushed to the undo stack.
Undo command to undo/redo all composer item related changes.
QDomDocument mAfterState
XML containing the state after executing the command.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
QgsComposerItem * mItem
Target item of the command.
QgsComposerMultiFrame * mMultiFrame
Parameters for frame items.
static QgsProject * instance()
access to canonical QgsProject instance
QDomDocument afterState() const
int frameIndex(QgsComposerFrame *frame) const
Returns the index of a frame within the multiframe.
void redo() override
Replays the command.
QgsComposerFrame * frame(int i) const
Returns a child frame from the multiframe.
QgsComposerItemCommand(QgsComposerItem *item, const QString &text, QUndoCommand *parent=0)
QgsComposerMultiFrame * multiFrame() const
Returns the parent multiframe for the frame.
QgsComposerItem * item() const
Returns the target item the command applies to.
QDomDocument mPreviousState
XML that saves the state before executing the command.