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

#include <KoKeepShapesSelectedCommand.h>

+ Inheritance diagram for KoKeepShapesSelectedCommand:

Public Member Functions

 KoKeepShapesSelectedCommand (const QList< KoShape * > &selectedBefore, const QList< KoShape * > &selectedAfter, KoSelectedShapesProxy *selectionProxy, bool isFinalizing, KUndo2Command *parent)
 
- Public Member Functions inherited from KisCommandUtils::FlipFlopCommand
 FlipFlopCommand (bool finalizing=false, KUndo2Command *parent=0)
 
 FlipFlopCommand (State initialState, KUndo2Command *parent=0)
 
void redo () override
 
void undo () 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 ()
 

Protected Member Functions

void partB () override
 
- Protected Member Functions inherited from KisCommandUtils::FlipFlopCommand
State getState () const
 
bool isFirstRedo () const
 
virtual void partA ()
 

Private Attributes

QList< KoShape * > m_selectedAfter
 
QList< KoShape * > m_selectedBefore
 
KoSelectedShapesProxy * m_selectionProxy
 

Additional Inherited Members

- Public Types inherited from KisCommandUtils::FlipFlopCommand
enum  State { INITIALIZING , FINALIZING }
 

Detailed Description

Definition at line 17 of file KoKeepShapesSelectedCommand.h.

Constructor & Destructor Documentation

◆ KoKeepShapesSelectedCommand()

KoKeepShapesSelectedCommand::KoKeepShapesSelectedCommand ( const QList< KoShape * > & selectedBefore,
const QList< KoShape * > & selectedAfter,
KoSelectedShapesProxy * selectionProxy,
bool isFinalizing,
KUndo2Command * parent )

Definition at line 14 of file KoKeepShapesSelectedCommand.cpp.

19 : KisCommandUtils::FlipFlopCommand(isFinalizing, parent),
20 m_selectedBefore(selectedBefore),
21 m_selectedAfter(selectedAfter),
22 m_selectionProxy(selectionProxy)
23{
24
25}

Member Function Documentation

◆ partB()

void KoKeepShapesSelectedCommand::partB ( )
overrideprotectedvirtual

Reimplemented from KisCommandUtils::FlipFlopCommand.

Definition at line 27 of file KoKeepShapesSelectedCommand.cpp.

28{
30
31 selection->deselectAll();
32
33 const QList<KoShape*> newSelectedShapes =
34 getState() == FlipFlopCommand::State::FINALIZING ? m_selectedAfter : m_selectedBefore;
35
36 Q_FOREACH (KoShape *shape, newSelectedShapes) {
37 selection->select(shape);
38 }
39}
virtual KoSelection * selection()=0
void deselectAll()
clear the selections list
void select(KoShape *shape)

References KoSelection::deselectAll(), KisCommandUtils::FlipFlopCommand::getState(), m_selectedAfter, m_selectedBefore, m_selectionProxy, KoSelection::select(), and KoSelectedShapesProxy::selection().

Member Data Documentation

◆ m_selectedAfter

QList<KoShape*> KoKeepShapesSelectedCommand::m_selectedAfter
private

Definition at line 31 of file KoKeepShapesSelectedCommand.h.

◆ m_selectedBefore

QList<KoShape*> KoKeepShapesSelectedCommand::m_selectedBefore
private

Definition at line 30 of file KoKeepShapesSelectedCommand.h.

◆ m_selectionProxy

KoSelectedShapesProxy* KoKeepShapesSelectedCommand::m_selectionProxy
private

Definition at line 32 of file KoKeepShapesSelectedCommand.h.


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