Krita Source Code Documentation
Loading...
Searching...
No Matches
KisChangeValueCommand< mem_ptr, ValueType > Struct Template Reference

#include <KisChangeValueCommand.h>

Detailed Description

template<auto mem_ptr, typename ValueType>
struct KisChangeValueCommand< mem_ptr, ValueType >

A simple command that flips the state of a member variable in a contained structure.

For example, to change the variable m_d->fooBar to the value newValue in an undoable fashion, just create a command like that:

   \code{.cpp}

   KUndo2Command *cmd =
       makeChangeValueCommand<&Private::fooBar>(m_d.data(), newValue);

   \endcode

It is not strictly necessary that newValue had the same type as the type of the member variable. They may differ, given the types are convertible.

Definition at line 25 of file KisChangeValueCommand.h.


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