|
Krita Source Code Documentation
|
The undo / redo command for changing a parameter. More...
#include <KoParameterHandleMoveCommand.h>
Inheritance diagram for KoParameterHandleMoveCommand:Public Member Functions | |
| int | id () const override |
| KoParameterHandleMoveCommand (KoParameterShape *shape, int handleId, const QPointF &startPoint, const QPointF &endPoint, Qt::KeyboardModifiers keyModifiers, KUndo2Command *parent=0) | |
| bool | mergeWith (const KUndo2Command *command) override |
| void | redo () override |
| redo the command | |
| void | undo () override |
| revert the actions done in redo | |
| ~KoParameterHandleMoveCommand () override | |
Public Member Functions inherited from KUndo2Command | |
| QString | actionText () const |
| virtual bool | canAnnihilateWith (const KUndo2Command *other) const |
| const KUndo2Command * | child (int index) const |
| int | childCount () const |
| virtual QTime | endTime () const |
| KUndo2CommandExtraData * | extraData () const |
| bool | hasParent () const |
| virtual bool | isMerged () const |
| KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0) | |
| KUndo2Command (KUndo2Command *parent=0) | |
| virtual QVector< KUndo2Command * > | mergeCommandsVector () const |
| virtual void | redoMergedCommands () |
| void | setEndTime () |
| virtual void | setEndTime (const QTime &time) |
| void | setExtraData (KUndo2CommandExtraData *data) |
| void | setText (const KUndo2MagicString &text) |
| void | setTime () |
| virtual void | setTime (const QTime &time) |
| virtual void | setTimedID (int timedID) |
| KUndo2MagicString | text () const |
| virtual QTime | time () const |
| virtual int | timedId () const |
| virtual bool | timedMergeWith (KUndo2Command *other) |
| virtual void | undoMergedCommands () |
| virtual | ~KUndo2Command () |
Private Attributes | |
| QPointF | m_endPoint |
| int | m_handleId |
| Qt::KeyboardModifiers | m_keyModifiers |
| KoParameterShape * | m_shape |
| QPointF | m_startPoint |
The undo / redo command for changing a parameter.
Definition at line 19 of file KoParameterHandleMoveCommand.h.
| KoParameterHandleMoveCommand::KoParameterHandleMoveCommand | ( | KoParameterShape * | shape, |
| int | handleId, | ||
| const QPointF & | startPoint, | ||
| const QPointF & | endPoint, | ||
| Qt::KeyboardModifiers | keyModifiers, | ||
| KUndo2Command * | parent = 0 ) |
Constructor.
| shape | the shape this command works on |
| handleId | the ID under which the parameterShape knows the handle in KoParameterShape::moveHandle() |
| startPoint | The old position |
| endPoint | The new position |
| keyModifiers | the key modifiers used while moving. |
| parent | the parent command if this is a compound undo command. |
Definition at line 14 of file KoParameterHandleMoveCommand.cpp.
References kundo2_i18n(), and KUndo2Command::setText().
|
override |
Definition at line 25 of file KoParameterHandleMoveCommand.cpp.
|
overridevirtual |
Returns the ID of this command.
A command ID is used in command compression. It must be an integer unique to this command's class, or -1 if the command doesn't support compression.
If the command supports compression this function must be overridden in the derived class to return the correct ID. The base implementation returns -1.
KUndo2QStack::push() will only try to merge two commands if they have the same ID, and the ID is not -1.
Reimplemented from KUndo2Command.
Definition at line 47 of file KoParameterHandleMoveCommand.cpp.
References KisCommandUtils::ChangeShapeParameterId.
|
overridevirtual |
Attempts to merge this command with command. Returns true on success; otherwise returns false.
If this function returns true, calling this command's redo() must have the same effect as redoing both this command and command. Similarly, calling this command's undo() must have the same effect as undoing command and this command.
KUndo2QStack will only try to merge two commands if they have the same id, and the id is not -1.
The default implementation returns false.
Reimplemented from KUndo2Command.
Definition at line 52 of file KoParameterHandleMoveCommand.cpp.
References m_endPoint, m_handleId, m_keyModifiers, and m_shape.
|
overridevirtual |
redo the command
Reimplemented from KUndo2Command.
Definition at line 30 of file KoParameterHandleMoveCommand.cpp.
References m_endPoint, m_handleId, m_keyModifiers, m_shape, KoParameterShape::moveHandle(), KUndo2Command::redo(), and KoShapeContainer::update().
|
overridevirtual |
revert the actions done in redo
Reimplemented from KUndo2Command.
Definition at line 39 of file KoParameterHandleMoveCommand.cpp.
References m_handleId, m_shape, m_startPoint, KoParameterShape::moveHandle(), KUndo2Command::undo(), and KoShapeContainer::update().
|
private |
Definition at line 46 of file KoParameterHandleMoveCommand.h.
|
private |
Definition at line 44 of file KoParameterHandleMoveCommand.h.
|
private |
Definition at line 47 of file KoParameterHandleMoveCommand.h.
|
private |
Definition at line 43 of file KoParameterHandleMoveCommand.h.
|
private |
Definition at line 45 of file KoParameterHandleMoveCommand.h.