|
Krita Source Code Documentation
|
The LambdaCommand struct is a shorthand for creation of AggregateCommand commands using C++ lambda feature. Just pass a lambda object into a command and it will be called from within the context of the strokes thread to populate the command content. More...
#include <kis_command_utils.h>
Inheritance diagram for KisCommandUtils::LambdaCommand:Public Member Functions | |
| LambdaCommand (const KUndo2MagicString &text, KUndo2Command *parent, std::function< KUndo2Command *()> createCommandFunc) | |
| LambdaCommand (const KUndo2MagicString &text, std::function< KUndo2Command *()> createCommandFunc) | |
| LambdaCommand (KUndo2Command *parent, std::function< KUndo2Command *()> createCommandFunc) | |
| LambdaCommand (std::function< KUndo2Command *()> createCommandFunc) | |
Public Member Functions inherited from KisCommandUtils::AggregateCommand | |
| AggregateCommand (const KUndo2MagicString &text, KUndo2Command *parent=0) | |
| AggregateCommand (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 | populateChildCommands () override |
Protected Member Functions inherited from KisCommandUtils::AggregateCommand | |
| void | addCommand (KUndo2Command *cmd) |
Private Attributes | |
| std::function< KUndo2Command *()> | m_createCommandFunc |
The LambdaCommand struct is a shorthand for creation of AggregateCommand commands using C++ lambda feature. Just pass a lambda object into a command and it will be called from within the context of the strokes thread to populate the command content.
Definition at line 50 of file kis_command_utils.h.
| KisCommandUtils::LambdaCommand::LambdaCommand | ( | std::function< KUndo2Command *()> | createCommandFunc | ) |
Definition at line 42 of file kis_command_utils.cpp.
| KisCommandUtils::LambdaCommand::LambdaCommand | ( | const KUndo2MagicString & | text, |
| std::function< KUndo2Command *()> | createCommandFunc ) |
Definition at line 48 of file kis_command_utils.cpp.
| KisCommandUtils::LambdaCommand::LambdaCommand | ( | const KUndo2MagicString & | text, |
| KUndo2Command * | parent, | ||
| std::function< KUndo2Command *()> | createCommandFunc ) |
Definition at line 56 of file kis_command_utils.cpp.
| KisCommandUtils::LambdaCommand::LambdaCommand | ( | KUndo2Command * | parent, |
| std::function< KUndo2Command *()> | createCommandFunc ) |
Definition at line 64 of file kis_command_utils.cpp.
|
overrideprotectedvirtual |
We should release all the potential resources owned by the attached lambda
Implements KisCommandUtils::AggregateCommand.
Definition at line 71 of file kis_command_utils.cpp.
References KisCommandUtils::AggregateCommand::addCommand(), and m_createCommandFunc.
|
private |
Definition at line 64 of file kis_command_utils.h.