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

API docs go here. More...

#include <KoShapeRenameCommand.h>

+ Inheritance diagram for KoShapeRenameCommand:

Public Member Functions

 KoShapeRenameCommand (KoShape *shape, const QString &newName, KUndo2Command *parent=0)
 
 Private (KoShape *shape, const QString &newName)
 
void redo () override
 redo the command
 
void undo () override
 revert the actions done in redo
 
 ~KoShapeRenameCommand () 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 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 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 ()
 

Public Attributes

QString newName
 
QString oldName
 
KoShape * shape
 

Private Attributes

Private *const d
 
- Private Attributes inherited from Private
KisCanvas2 * canvas
 
int displayedFrame
 
int intendedFrame
 

Additional Inherited Members

- Private Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Detailed Description

API docs go here.

Definition at line 13 of file KoShapeRenameCommand.cpp.

Constructor & Destructor Documentation

◆ KoShapeRenameCommand()

KoShapeRenameCommand::KoShapeRenameCommand ( KoShape * shape,
const QString & newName,
KUndo2Command * parent = 0 )

Definition at line 27 of file KoShapeRenameCommand.cpp.

28 : KUndo2Command(kundo2_i18n("Rename Shape"), parent)
29, d(new Private(shape, newName))
30{
31}
KUndo2Command(KUndo2Command *parent=0)
KUndo2MagicString kundo2_i18n(const char *text)

◆ ~KoShapeRenameCommand()

KoShapeRenameCommand::~KoShapeRenameCommand ( )
override

Definition at line 33 of file KoShapeRenameCommand.cpp.

34{
35 delete d;
36}

References d.

Member Function Documentation

◆ Private()

KoShapeRenameCommand::Private ( KoShape * shape,
const QString & newName )
inline

Definition at line 16 of file KoShapeRenameCommand.cpp.

17 : shape(shape)
19 , oldName(shape->name())
20 {}
QString name() const
Definition KoShape.cpp:950

◆ redo()

void KoShapeRenameCommand::redo ( )
overridevirtual

redo the command

Reimplemented from KUndo2Command.

Definition at line 38 of file KoShapeRenameCommand.cpp.

39{
41 d->shape->setName(d->newName);
42}
virtual void redo()

References d, and KUndo2Command::redo().

◆ undo()

void KoShapeRenameCommand::undo ( )
overridevirtual

revert the actions done in redo

Reimplemented from KUndo2Command.

Definition at line 44 of file KoShapeRenameCommand.cpp.

45{
47 d->shape->setName(d->oldName);
48}
virtual void undo()

References d, and KUndo2Command::undo().

Member Data Documentation

◆ d

Private* const KoShapeRenameCommand::d
private

Definition at line 30 of file KoShapeRenameCommand.h.

◆ newName

QString KoShapeRenameCommand::newName

Definition at line 23 of file KoShapeRenameCommand.cpp.

◆ oldName

QString KoShapeRenameCommand::oldName

Definition at line 24 of file KoShapeRenameCommand.cpp.

◆ shape

KoShape* KoShapeRenameCommand::shape

Definition at line 22 of file KoShapeRenameCommand.cpp.


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