Krita Source Code Documentation
Loading...
Searching...
No Matches
RemoveSwatchCommand Struct Reference
+ Inheritance diagram for RemoveSwatchCommand:

Public Member Functions

void redo () override
 redo the command
 
 RemoveSwatchCommand (KoColorSet *colorSet, int column, int row, KisSwatchGroupSP group)
 
void undo () override
 revert the actions done in redo
 
- 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 ()
 

Private Attributes

KoColorSet * m_colorSet
 
KisSwatchGroupSP m_group
 
KisSwatch m_swatch
 
int m_x
 
int m_y
 

Detailed Description

Definition at line 151 of file KoColorSet.cpp.

Constructor & Destructor Documentation

◆ RemoveSwatchCommand()

RemoveSwatchCommand::RemoveSwatchCommand ( KoColorSet * colorSet,
int column,
int row,
KisSwatchGroupSP group )
inline

Definition at line 153 of file KoColorSet.cpp.

154 : m_colorSet(colorSet)
155 , m_swatch(group->getSwatch(column, row))
156 , m_group(group)
157 , m_x(column)
158 , m_y(row)
159
160 {
161 }
KisSwatchGroupSP m_group
KoColorSet * m_colorSet

Member Function Documentation

◆ redo()

void RemoveSwatchCommand::redo ( )
inlineoverridevirtual

redo the command

Reimplemented from KUndo2Command.

Definition at line 164 of file KoColorSet.cpp.

165 {
166 m_group->removeSwatch(m_x, m_y);
168 }
void notifySwatchChanged(const QString &groupName, int column, int row)

References m_colorSet, m_group, m_x, m_y, and KoColorSet::notifySwatchChanged().

◆ undo()

void RemoveSwatchCommand::undo ( )
inlineoverridevirtual

revert the actions done in redo

Reimplemented from KUndo2Command.

Definition at line 171 of file KoColorSet.cpp.

172 {
173 m_group->setSwatch(m_swatch, m_x, m_y);
175 }

References m_colorSet, m_group, m_swatch, m_x, m_y, and KoColorSet::notifySwatchChanged().

Member Data Documentation

◆ m_colorSet

KoColorSet* RemoveSwatchCommand::m_colorSet
private

Definition at line 178 of file KoColorSet.cpp.

◆ m_group

KisSwatchGroupSP RemoveSwatchCommand::m_group
private

Definition at line 180 of file KoColorSet.cpp.

◆ m_swatch

KisSwatch RemoveSwatchCommand::m_swatch
private

Definition at line 179 of file KoColorSet.cpp.

◆ m_x

int RemoveSwatchCommand::m_x
private

Definition at line 181 of file KoColorSet.cpp.

◆ m_y

int RemoveSwatchCommand::m_y
private

Definition at line 182 of file KoColorSet.cpp.


The documentation for this struct was generated from the following file: