Krita Source Code Documentation
Loading...
Searching...
No Matches
KUndo2Command Class Reference

#include <kundo2stack.h>

+ Inheritance diagram for KUndo2Command:

Public Member Functions

QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Commandchild (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraDataextraData () const
 
bool hasParent () const
 
virtual int id () const
 
virtual bool isMerged () const
 
 KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 KUndo2Command (KUndo2Command *parent=0)
 
virtual QVector< KUndo2Command * > mergeCommandsVector () const
 
virtual bool mergeWith (const KUndo2Command *other)
 
virtual void redo ()
 
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 undo ()
 
virtual void undoMergedCommands ()
 
virtual ~KUndo2Command ()
 

Private Attributes

KUndo2CommandPrivated {0}
 
QTime m_endOfCommand
 
bool m_hasParent {false}
 
QVector< KUndo2Command * > m_mergeCommandsVector
 
int m_timedID {-1}
 
QTime m_timeOfCreation
 

Friends

class KUndo2QStack
 

Detailed Description

WARNING: In general, don't derive undo commands from QObject. And if you really need it, don't use QObject lifetime tracking for the commands: KUndo2Command has its own, nonvirtual hierarchy, and don't make it a parent or a child of any QObject. Otherwise two different parents will try to track the lifetime of your command and, most probably, you'll get a crash.

As a general rule: an undo command should be derived from QObject only for the sake of signal/slots capabilities. Nothing else.

Definition at line 86 of file kundo2stack.h.

Constructor & Destructor Documentation

◆ KUndo2Command() [1/2]

KUndo2Command::KUndo2Command ( KUndo2Command * parent = 0)
explicit

Constructs a KUndo2Command object with parent parent.

If parent is not 0, this command is appended to parent's child list. The parent command then owns this command and will delete it in its destructor.

See also
~KUndo2Command()

Definition at line 145 of file kundo2stack.cpp.

146 : m_hasParent(parent != 0)
147{
149 if (parent != 0)
150 parent->d->child_list.append(this);
151 setTime();
152}
KUndo2CommandPrivate * d
Definition kundo2stack.h:88
ChildIterator< value_type, is_const > parent(const ChildIterator< value_type, is_const > &it)
Definition KisForest.h:327

References d, and setTime().

◆ KUndo2Command() [2/2]

KUndo2Command::KUndo2Command ( const KUndo2MagicString & text,
KUndo2Command * parent = 0 )
explicit
\class KUndo2Command
\brief The KUndo2Command class is the base class of all commands stored on a KUndo2QStack.
\since 4.2

For an overview of Qt's Undo Framework, see the
\l{Overview of Qt's Undo Framework}{overview document}.

A KUndo2Command represents a single editing action on a document; for example,
inserting or deleting a block of text in a text editor. KUndo2Command can apply
a change to the document with redo() and undo the change with undo(). The
implementations for these functions must be provided in a derived class.

\snippet doc/src/snippets/code/src_gui_util_qundostack.cpp 0

A KUndo2Command has an associated text(). This is a short string
describing what the command does. It is used to update the text
properties of the stack's undo and redo actions; see
KUndo2QStack::createUndoAction() and KUndo2QStack::createRedoAction().

KUndo2Command objects are owned by the stack they were pushed on.
KUndo2QStack deletes a command if it has been undone and a new command is pushed. For example:
In effect, when a command is pushed, it becomes the top-most command
on the stack.

To support command compression, KUndo2Command has an id() and the virtual function
mergeWith(). These functions are used by KUndo2QStack::push().

To support command macros, a KUndo2Command object can have any number of child
commands. Undoing or redoing the parent command will cause the child
commands to be undone or redone. A command can be assigned
to a parent explicitly in the constructor. In this case, the command
will be owned by the parent.

The parent in this case is usually an empty command, in that it doesn't
provide its own implementation of undo() and redo(). Instead, it uses
the base implementations of these functions, which simply call undo() or
redo() on all its children. The parent should, however, have a meaningful
text().

\snippet doc/src/snippets/code/src_gui_util_qundostack.cpp 2

Another way to create macros is to use the convenience functions
KUndo2QStack::beginMacro() and KUndo2QStack::endMacro().

\sa KUndo2QStack

Constructs a KUndo2Command object with the given parent and text.

If parent is not 0, this command is appended to parent's child list. The parent command then owns this command and will delete it in its destructor.

See also
~KUndo2Command()

Definition at line 123 of file kundo2stack.cpp.

124 : m_hasParent(parent != 0)
125 , m_endOfCommand(QTime::currentTime())
126{
128 if (parent != 0) {
129 parent->d->child_list.append(this);
130 }
131 setText(text);
132 setTime();
133}
void setText(const KUndo2MagicString &text)
KUndo2MagicString text() const
QTime m_endOfCommand

References d, setText(), setTime(), and text().

◆ ~KUndo2Command()

KUndo2Command::~KUndo2Command ( )
virtual

Destroys the KUndo2Command object and all child commands.

See also
KUndo2Command()

Definition at line 160 of file kundo2stack.cpp.

161{
162 qDeleteAll(d->child_list);
163 delete d;
164}
QList< KUndo2Command * > child_list

References KUndo2CommandPrivate::child_list, and d.

Member Function Documentation

◆ actionText()

QString KUndo2Command::actionText ( ) const

Returns a short text string describing what this command does; for example, "insert text".

The text is used when the text properties of the stack's undo and redo actions are updated.

See also
setText(), KUndo2QStack::createUndoAction(), KUndo2QStack::createRedoAction()

Definition at line 256 of file kundo2stack.cpp.

257{
258 if (!d->actionText.isEmpty())
259 return d->actionText;
260 else
261 return QString();
262}

References KUndo2CommandPrivate::actionText, and d.

◆ canAnnihilateWith()

bool KUndo2Command::canAnnihilateWith ( const KUndo2Command * other) const
virtual

Attempts to merge this command with command and checks if the two commands compensate each other. If the function returns true, both commands are removed from the stack.

If this function returns true, calling this command's redo() followed by other redo() must have no effect.

The function itself shouldn't do any changes to the command, because after returning true, the command will be deleted as a "noop"

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.

See also
id() KUndo2QStack::push()

Reimplemented in KisNodeCompositeOpCommand, KisNodeOpacityCommand, KisSavedCommand, KisSavedMacroCommand, and KisNodePropertyListCommand.

Definition at line 364 of file kundo2stack.cpp.

365{
366 Q_UNUSED(other)
367 return false;
368}

◆ child()

const KUndo2Command * KUndo2Command::child ( int index) const
Since
4.4

Returns the child command at index.

See also
childCount(), KUndo2QStack::command()

Definition at line 315 of file kundo2stack.cpp.

316{
317 if (index < 0 || index >= d->child_list.count())
318 return 0;
319 return d->child_list.at(index);
320}

References KUndo2CommandPrivate::child_list, and d.

◆ childCount()

int KUndo2Command::childCount ( ) const
Since
4.4

Returns the number of child commands in this command.

See also
child()

Definition at line 302 of file kundo2stack.cpp.

303{
304 return d->child_list.count();
305}

References KUndo2CommandPrivate::child_list, and d.

◆ endTime()

QTime KUndo2Command::endTime ( ) const
virtual

Reimplemented in KisSavedCommand.

Definition at line 393 of file kundo2stack.cpp.

394{
395 return m_endOfCommand;
396}

References m_endOfCommand.

◆ extraData()

KUndo2CommandExtraData * KUndo2Command::extraData ( ) const
Returns
user-defined object associated with the command
See also
setExtraData()

Definition at line 434 of file kundo2stack.cpp.

435{
436 return d->extraData.data();
437}
QScopedPointer< KUndo2CommandExtraData > extraData

References d, and KUndo2CommandPrivate::extraData.

◆ hasParent()

bool KUndo2Command::hasParent ( ) const

Definition at line 322 of file kundo2stack.cpp.

323{
324 return m_hasParent;
325}

References m_hasParent.

◆ id()

int KUndo2Command::id ( ) const
virtual

◆ isMerged()

bool KUndo2Command::isMerged ( ) const
virtual

Reimplemented in KisSavedCommand.

Definition at line 429 of file kundo2stack.cpp.

430{
431 return !m_mergeCommandsVector.isEmpty();
432}
QVector< KUndo2Command * > m_mergeCommandsVector

References m_mergeCommandsVector.

◆ mergeCommandsVector()

QVector< KUndo2Command * > KUndo2Command::mergeCommandsVector ( ) const
virtual

Reimplemented in KisSavedCommand.

Definition at line 425 of file kundo2stack.cpp.

426{
428}

References m_mergeCommandsVector.

◆ mergeWith()

bool KUndo2Command::mergeWith ( const KUndo2Command * command)
virtual

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.

See also
id() KUndo2QStack::push()

Reimplemented in KisChangeCloneLayersCommand, KoParameterHandleMoveCommand, KoPathControlPointMoveCommand, KoPathPointMoveCommand, KoPathShapeMarkerCommand, KoShapeBackgroundCommand, KoShapeMergeTextPropertiesCommand, KoShapeMoveCommand, KoShapePaintOrderCommand, KoShapeResizeCommand, KoShapeStrokeCommand, KoShapeTransformCommand, KoShapeTransparencyCommand, KisNodeCompositeOpCommand, KisNodeOpacityCommand, KisNodePropertyListCommand, KisNodeRenameCommand, KisChangeProjectionColorCommand, KisSavedCommand, KisSavedMacroCommand, KisSwitchCurrentTimeCommand, KisSwitchCurrentTimeToKeyframeCommand, DisableUIUpdatesCommand, UpdateCommand, EmitImageSignalsCommand, EllipseShapeConfigCommand, RectangleShapeConfigCommand, KisLayerCollapseCommand, KisSimpleModifyTransformMaskCommand, KisStoryboardChildEditCommand, SvgInlineSizeChangeCommand, SvgMoveTextCommand, SvgTextInsertCommand, SvgTextMergePropertiesRangeCommand, SvgTextRemoveCommand, and KisImageAnimSettingCommand.

Definition at line 205 of file kundo2stack.cpp.

206{
207 Q_UNUSED(command);
208 return false;
209}

◆ redo()

void KUndo2Command::redo ( )
virtual

Applies a change to the document. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.

The default implementation calls redo() on all child commands.

See also
undo()

Reimplemented in KisChangeValueCommand< mem_ptr, ValueType >, KisChangeIndirectValueCommand< mem_ptr, ValueType >, KisChangeDeselectedMaskCommand, KisCommandUtils::AggregateCommand, KisCommandUtils::SkipFirstRedoWrapper, KisCommandUtils::FlipFlopCommand, KisCommandUtils::CompositeCommand, KoMultiPathPointMergeCommand, KoParameterHandleMoveCommand, KoParameterToPathCommand, KoPathBreakAtPointCommand, KoPathCombineCommand, KoPathControlPointMoveCommand, KoPathFillRuleCommand, KoPathPointInsertCommand, KoPathPointMergeCommand, KoPathPointMoveCommand, KoPathPointRemoveCommand, KoPathPointTypeCommand, KoPathReverseCommand, KoPathSegmentBreakCommand, KoPathSegmentTypeCommand, KoPathShapeMarkerCommand, KoShapeAlignCommand, KoShapeBackgroundCommand, KoShapeClipCommand, KoShapeConnectionChangeCommand, KoShapeCreateCommand, KoShapeDeleteCommand, KoShapeDistributeCommand, KoShapeGroupCommand, KoShapeKeepAspectRatioCommand, KoShapeLockCommand, KoShapeMergeTextPropertiesCommand, KoShapeMoveCommand, KoShapePaintOrderCommand, KoShapeRenameCommand, KoShapeReorderCommand, KoShapeRunAroundCommand, KoShapeShadowCommand, KoShapeShearCommand, KoShapeSizeCommand, KoShapeStrokeCommand, KoShapeTransformCommand, KoShapeTransparencyCommand, KoShapeUnclipCommand, KoShapeUngroupCommand, KoSubpathJoinCommand, KoSubpathRemoveCommand, KoSvgConvertTextTypeCommand, KisChangeFilterCmd, KisImageChangeLayersCommand, KisImageChangeVisibilityCommand, KisImageLayerAddCommand, KisImageLayerMoveCommand, KisImageLayerRemoveCommand, KisImageLayerRemoveCommandImpl, KisNodeCompositeOpCommand, KisNodeOpacityCommand, KisNodePropertyListCommand, KisBatchUpdateLayerModificationCommand, KisDeselectActiveSelectionCommand, KisNodeRenameCommand, KisReselectActiveSelectionCommand, KisActivateSelectionMaskCommand, KisChangeProjectionColorCommand, KisImageResizeCommand, KisImageSetResolutionCommand, KisResetShapesCommand, KisMoveCommandCommon< ObjectSP >, KisMoveCommandCommon< KisNodeSP >, KisMoveCommandCommon< KisSelectionSP >, KisNodeMoveCommand2, KisProcessingCommand, KisSavedCommandBase, KisSelectionMoveCommand2, KisSetLayerStyleCommand, KisSwitchCurrentTimeCommand, KisSwitchCurrentTimeToKeyframeCommand, KisTransactionBasedCommand, KisUpdateCommand, KisChangeChannelFlagsCommand, KisChangeChannelLockFlagsCommand, KisChangeCloneLayersCommand, KisImageAnimSettingCommand, KisLayerCollapseCommand, KisMergeLabeledLayersCommand, KisSimpleModifyTransformMaskCommand, KisDoSomethingCommand< DoSomethingOp, LayerType >, KisInsertKeyframeCommand, KisRemoveKeyframeCommand, KisScalarKeyframeUpdateCommand, KisLayerUtils::FillSelectionMasks, KisLayerUtils::RefreshDelayedUpdateLayers, KisLayerUtils::MergeMetaData, KisLayerUtils::SplitAlphaCommand, KisLayerUtils::SelectGlobalSelectionMask, KisPaintDevice::Private::FrameInsertionCommand, KisPaintDevice::Private::DeviceChangeProfileCommand, KisPaintDeviceData::ChangeProfileCommand, KisPaintDeviceData::ChangeColorSpaceCommand, KisSelection::ChangeShapeSelectionCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::SuspendUpdatesCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::ResumeAndIssueGraphUpdatesCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand, KisTransactionData, KisChangeOverlayWrapperCommand, SetKeyStrokesColorSpaceCommand, SetKeyStrokeColorsCommand, AddSwatchCommand, RemoveSwatchCommand, ChangeGroupNameCommand, MoveGroupCommand, AddGroupCommand, RemoveGroupCommand, ClearCommand, SetColumnCountCommand, SetCommentCommand, SetPaletteTypeCommand, KisTransformToolActivationCommand, KisChangeGuidesCommand, TransformShapeLayerDeferred, KisTakeAllShapesCommand, AddReferenceImagesCommand, RemoveReferenceImagesCommand, KisChangeFileLayerCmd, KisGuiContextCommand, MultinodePropertyUndoCommand< PropertyAdapter >, KisReferenceImage::SetSaturationCommand, EditAssistantsCommand, KisAddStoryboardCommand, KisRemoveStoryboardCommand, KisDuplicateStoryboardCommand, KisMoveStoryboardCommand, KisVisualizeStoryboardCommand, KisStoryboardChildEditCommand, KisQmicSynchronizeLayersCommand, EllipseShapeConfigCommand, RectangleShapeConfigCommand, SpiralShapeConfigCommand, StarShapeConfigCommand, SvgInlineSizeChangeCommand, SvgMoveTextCommand, SvgTextChangeCommand, SvgTextInsertCommand, SvgTextInsertRichCommand, SvgTextMergePropertiesRangeCommand, SvgTextRemoveCommand, and KisCommandUtils::SkipFirstRedoBase.

Definition at line 222 of file kundo2stack.cpp.

223{
224 for (int i = 0; i < d->child_list.size(); ++i)
225 d->child_list.at(i)->redo();
226}

References KUndo2CommandPrivate::child_list, and d.

◆ redoMergedCommands()

void KUndo2Command::redoMergedCommands ( )
virtual

Definition at line 412 of file kundo2stack.cpp.

413{
414 if (!mergeCommandsVector().isEmpty()) {
415
416 QVectorIterator<KUndo2Command*> it(mergeCommandsVector());
417 it.toBack();
418 while (it.hasPrevious()) {
419 KUndo2Command* cmd = it.previous();
420 cmd->redoMergedCommands();
421 }
422 }
423 redo();
424}
virtual void redoMergedCommands()
virtual void redo()
virtual QVector< KUndo2Command * > mergeCommandsVector() const

References mergeCommandsVector(), redo(), and redoMergedCommands().

◆ setEndTime() [1/2]

void KUndo2Command::setEndTime ( )

Definition at line 385 of file kundo2stack.cpp.

386{
387 setEndTime(QTime::currentTime());
388}

References setEndTime().

◆ setEndTime() [2/2]

void KUndo2Command::setEndTime ( const QTime & time)
virtual

Reimplemented in KisSavedCommand.

Definition at line 389 of file kundo2stack.cpp.

390{
392}
virtual QTime time() const

References m_endOfCommand, and time().

◆ setExtraData()

void KUndo2Command::setExtraData ( KUndo2CommandExtraData * data)

The user can assign an arbitrary object associated with the command. The data object is owned by the command. If you assign the object twice, the first one will be destroyed.

Definition at line 439 of file kundo2stack.cpp.

440{
441 d->extraData.reset(data);
442}

References d, and KUndo2CommandPrivate::extraData.

◆ setText()

void KUndo2Command::setText ( const KUndo2MagicString & undoText)

Sets the command's text to be the text specified.

The specified text should be a short user-readable string describing what this command does.

See also
text() KUndo2QStack::createUndoAction() KUndo2QStack::createRedoAction()

Definition at line 288 of file kundo2stack.cpp.

289{
290 d->text = undoText;
291 d->actionText = undoText.toSecondaryString();
292}
KUndo2MagicString text
QString toSecondaryString() const

References KUndo2CommandPrivate::actionText, d, KUndo2CommandPrivate::text, and KUndo2MagicString::toSecondaryString().

◆ setTime() [1/2]

void KUndo2Command::setTime ( )

Definition at line 370 of file kundo2stack.cpp.

371{
372 setTime(QTime::currentTime());
373}

References setTime().

◆ setTime() [2/2]

void KUndo2Command::setTime ( const QTime & time)
virtual

Reimplemented in KisSavedCommand.

Definition at line 375 of file kundo2stack.cpp.

376{
378}
QTime m_timeOfCreation

References m_timeOfCreation, and time().

◆ setTimedID()

void KUndo2Command::setTimedID ( int timedID)
virtual

Reimplemented in KisSavedCommand.

Definition at line 331 of file kundo2stack.cpp.

332{
334}
float value(const T *src, size_t ch)

References m_timedID, and value().

◆ text()

KUndo2MagicString KUndo2Command::text ( ) const

Returns a short text string describing what this command does; for example, "insert text".

The text is used when the text properties of the stack's undo and redo actions are updated.

See also
setText(), KUndo2QStack::createUndoAction(), KUndo2QStack::createRedoAction()

Definition at line 274 of file kundo2stack.cpp.

275{
276 return d->text;
277}

References d, and KUndo2CommandPrivate::text.

◆ time()

QTime KUndo2Command::time ( ) const
virtual

Reimplemented in KisSavedCommand.

Definition at line 380 of file kundo2stack.cpp.

381{
382 return m_timeOfCreation;
383}

References m_timeOfCreation.

◆ timedId()

int KUndo2Command::timedId ( ) const
virtual

Reimplemented in KisSavedCommand.

Definition at line 327 of file kundo2stack.cpp.

328{
329 return m_timedID;
330}

References m_timedID.

◆ timedMergeWith()

bool KUndo2Command::timedMergeWith ( KUndo2Command * other)
virtual

Reimplemented in KisSavedCommand.

Definition at line 336 of file kundo2stack.cpp.

337{
338 if(other->timedId() == this->timedId() && other->timedId() != -1 ) {
339 m_mergeCommandsVector.append(other);
340 m_timeOfCreation = other->time();
341 } else {
342 return false;
343 }
344 return true;
345}
virtual int timedId() const

References m_mergeCommandsVector, m_timeOfCreation, time(), and timedId().

◆ undo()

void KUndo2Command::undo ( )
virtual

Reverts a change to the document. After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.

The default implementation calls undo() on all child commands in reverse order.

See also
redo()

Reimplemented in KisChangeValueCommand< mem_ptr, ValueType >, KisChangeIndirectValueCommand< mem_ptr, ValueType >, KisChangeDeselectedMaskCommand, KisCommandUtils::AggregateCommand, KisCommandUtils::SkipFirstRedoWrapper, KisCommandUtils::FlipFlopCommand, KisCommandUtils::CompositeCommand, KoMultiPathPointMergeCommand, KoParameterHandleMoveCommand, KoParameterToPathCommand, KoPathBreakAtPointCommand, KoPathCombineCommand, KoPathControlPointMoveCommand, KoPathFillRuleCommand, KoPathPointInsertCommand, KoPathPointMergeCommand, KoPathPointMoveCommand, KoPathPointRemoveCommand, KoPathPointTypeCommand, KoPathReverseCommand, KoPathSegmentBreakCommand, KoPathSegmentTypeCommand, KoPathShapeMarkerCommand, KoShapeAlignCommand, KoShapeBackgroundCommand, KoShapeClipCommand, KoShapeConnectionChangeCommand, KoShapeCreateCommand, KoShapeDeleteCommand, KoShapeDistributeCommand, KoShapeGroupCommand, KoShapeKeepAspectRatioCommand, KoShapeLockCommand, KoShapeMergeTextPropertiesCommand, KoShapeMoveCommand, KoShapePaintOrderCommand, KoShapeRenameCommand, KoShapeReorderCommand, KoShapeRunAroundCommand, KoShapeShadowCommand, KoShapeShearCommand, KoShapeSizeCommand, KoShapeStrokeCommand, KoShapeTransformCommand, KoShapeTransparencyCommand, KoShapeUnclipCommand, KoShapeUngroupCommand, KoSubpathJoinCommand, KoSubpathRemoveCommand, KoSvgConvertTextTypeCommand, KisChangeFilterCmd, KisImageChangeLayersCommand, KisImageChangeVisibilityCommand, KisImageLayerAddCommand, KisImageLayerMoveCommand, KisImageLayerRemoveCommand, KisImageLayerRemoveCommandImpl, KisNodeCompositeOpCommand, KisNodeOpacityCommand, KisNodePropertyListCommand, KisBatchUpdateLayerModificationCommand, KisDeselectActiveSelectionCommand, KisNodeRenameCommand, KisReselectActiveSelectionCommand, KisActivateSelectionMaskCommand, KisChangeProjectionColorCommand, KisImageResizeCommand, KisImageSetResolutionCommand, KisResetShapesCommand, KisMoveCommandCommon< ObjectSP >, KisMoveCommandCommon< KisNodeSP >, KisMoveCommandCommon< KisSelectionSP >, KisNodeMoveCommand2, KisProcessingCommand, KisSavedCommandBase, KisSelectionMoveCommand2, KisSetLayerStyleCommand, KisSwitchCurrentTimeCommand, KisSwitchCurrentTimeToKeyframeCommand, KisTransactionBasedCommand, KisUpdateCommand, KisChangeChannelFlagsCommand, KisChangeChannelLockFlagsCommand, KisChangeCloneLayersCommand, KisImageAnimSettingCommand, KisLayerCollapseCommand, KisMergeLabeledLayersCommand, KisSimpleModifyTransformMaskCommand, KisDoSomethingCommand< DoSomethingOp, LayerType >, KisInsertKeyframeCommand, KisRemoveKeyframeCommand, KisScalarKeyframeUpdateCommand, KisLayerUtils::SplitAlphaCommand, KisPaintDevice::Private::FrameInsertionCommand, KisPaintDevice::Private::DeviceChangeProfileCommand, KisPaintDeviceData::ChangeProfileCommand, KisPaintDeviceData::ChangeColorSpaceCommand, KisSelection::ChangeShapeSelectionCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::SuspendUpdatesCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::ResumeAndIssueGraphUpdatesCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand, KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand, KisTransactionData, KisChangeOverlayWrapperCommand, SetKeyStrokesColorSpaceCommand, SetKeyStrokeColorsCommand, AddSwatchCommand, RemoveSwatchCommand, ChangeGroupNameCommand, MoveGroupCommand, AddGroupCommand, RemoveGroupCommand, ClearCommand, SetColumnCountCommand, SetCommentCommand, SetPaletteTypeCommand, KisTransformToolActivationCommand, KisChangeGuidesCommand, TransformShapeLayerDeferred, KisTakeAllShapesCommand, AddReferenceImagesCommand, RemoveReferenceImagesCommand, KisChangeFileLayerCmd, KisGuiContextCommand, MultinodePropertyUndoCommand< PropertyAdapter >, KisReferenceImage::SetSaturationCommand, EditAssistantsCommand, KisAddStoryboardCommand, KisRemoveStoryboardCommand, KisDuplicateStoryboardCommand, KisMoveStoryboardCommand, KisVisualizeStoryboardCommand, KisStoryboardChildEditCommand, KisQmicSynchronizeLayersCommand, EllipseShapeConfigCommand, RectangleShapeConfigCommand, SpiralShapeConfigCommand, StarShapeConfigCommand, SvgInlineSizeChangeCommand, SvgMoveTextCommand, SvgTextChangeCommand, SvgTextInsertCommand, SvgTextInsertRichCommand, SvgTextMergePropertiesRangeCommand, SvgTextRemoveCommand, and KisCommandUtils::SkipFirstRedoBase.

Definition at line 240 of file kundo2stack.cpp.

241{
242 for (int i = d->child_list.size() - 1; i >= 0; --i)
243 d->child_list.at(i)->undo();
244}

References KUndo2CommandPrivate::child_list, and d.

◆ undoMergedCommands()

void KUndo2Command::undoMergedCommands ( )
virtual

Definition at line 398 of file kundo2stack.cpp.

399{
400
401 undo();
402 if (!mergeCommandsVector().isEmpty()) {
403 QVectorIterator<KUndo2Command*> it(mergeCommandsVector());
404 it.toFront();
405 while (it.hasNext()) {
406 KUndo2Command* cmd = it.next();
407 cmd->undoMergedCommands();
408 }
409 }
410}
virtual void undo()
virtual void undoMergedCommands()

References mergeCommandsVector(), undo(), and undoMergedCommands().

Friends And Related Symbol Documentation

◆ KUndo2QStack

friend class KUndo2QStack
friend

Definition at line 142 of file kundo2stack.h.

Member Data Documentation

◆ d

KUndo2CommandPrivate* KUndo2Command::d {0}
private

Definition at line 88 of file kundo2stack.h.

88{0};

◆ m_endOfCommand

QTime KUndo2Command::m_endOfCommand
private

Definition at line 149 of file kundo2stack.h.

◆ m_hasParent

bool KUndo2Command::m_hasParent {false}
private

Definition at line 145 of file kundo2stack.h.

145{false};

◆ m_mergeCommandsVector

QVector<KUndo2Command*> KUndo2Command::m_mergeCommandsVector
private

Definition at line 150 of file kundo2stack.h.

◆ m_timedID

int KUndo2Command::m_timedID {-1}
private

Definition at line 146 of file kundo2stack.h.

146{-1};

◆ m_timeOfCreation

QTime KUndo2Command::m_timeOfCreation
private

Definition at line 148 of file kundo2stack.h.


The documentation for this class was generated from the following files: