QGIS API Documentation
2.0.1-Dufour
|
A composer command that merges together with other commands having the same context (=id). More...
#include <qgscomposeritemcommand.h>
Public Member Functions | |
QgsComposerMergeCommand (Context c, QgsComposerItem *item, const QString &text) | |
~QgsComposerMergeCommand () | |
bool | mergeWith (const QUndoCommand *command) |
int | id () const |
Public Member Functions inherited from QgsComposerItemCommand | |
QgsComposerItemCommand (QgsComposerItem *item, const QString &text, QUndoCommand *parent=0) | |
virtual | ~QgsComposerItemCommand () |
void | undo () |
Reverses the command. | |
void | redo () |
Replays the command. | |
void | savePreviousState () |
Saves current item state as previous state. | |
void | saveAfterState () |
Saves current item state as after state. | |
QDomDocument | previousState () const |
QDomDocument | afterState () const |
bool | containsChange () const |
Returns true if previous state and after state are valid and different. | |
const QgsComposerItem * | item () const |
Private Attributes | |
Context | mContext |
Additional Inherited Members | |
Protected Member Functions inherited from QgsComposerItemCommand | |
void | saveState (QDomDocument &stateDoc) const |
void | restoreState (QDomDocument &stateDoc) const |
Protected Attributes inherited from QgsComposerItemCommand | |
QgsComposerItem * | mItem |
Target item of the command. | |
QDomDocument | mPreviousState |
XML that saves the state before executing the command. | |
QDomDocument | mAfterState |
XML containing the state after executing the command. | |
bool | mFirstRun |
Flag to prevent the first redo() if the command is pushed to the undo stack. |
A composer command that merges together with other commands having the same context (=id).
Keeps the oldest previous state and uses the newest after state. The purpose is to avoid too many micro changes in the history
Definition at line 68 of file qgscomposeritemcommand.h.
Definition at line 71 of file qgscomposeritemcommand.h.
QgsComposerMergeCommand::QgsComposerMergeCommand | ( | Context | c, |
QgsComposerItem * | item, | ||
const QString & | text | ||
) |
Definition at line 82 of file qgscomposeritemcommand.cpp.
QgsComposerMergeCommand::~QgsComposerMergeCommand | ( | ) |
Definition at line 86 of file qgscomposeritemcommand.cpp.
|
inline |
Definition at line 126 of file qgscomposeritemcommand.h.
bool QgsComposerMergeCommand::mergeWith | ( | const QUndoCommand * | command | ) |
Definition at line 90 of file qgscomposeritemcommand.cpp.
References QgsComposerItemCommand::afterState(), QgsComposerItemCommand::item(), QgsComposerItemCommand::mAfterState, and QgsComposerItemCommand::mItem.
|
private |
Definition at line 129 of file qgscomposeritemcommand.h.