|
Krita Source Code Documentation
|
#include <kis_signal_compressor_with_param.h>
Inheritance diagram for SignalToFunctionProxy:Public Types | |
| using | TrivialFunction = std::function<void ()> |
Public Slots | |
| void | start () |
Public Member Functions | |
| SignalToFunctionProxy (TrivialFunction function) | |
Private Attributes | |
| TrivialFunction | m_function |
A special class that converts a Qt signal into a std::function call.
Usage:
\code{.cpp}
std::function<void ()> destinationFunctionCall(std::bind(someNiceFunc, firstParam, secondParam));
SignalToFunctionProxy proxy(destinationFunctionCall);
connect(srcObject, SIGNAL(sigSomethingChanged()), &proxy, SLOT(start()));
\endcode
Now every time sigSomethingChanged() is emitted, someNiceFunc is called. std::bind allows us to call any method of any class without changing signature of the class or creating special wrappers.
Definition at line 31 of file kis_signal_compressor_with_param.h.
| using SignalToFunctionProxy::TrivialFunction = std::function<void ()> |
Definition at line 35 of file kis_signal_compressor_with_param.h.
|
inline |
Definition at line 38 of file kis_signal_compressor_with_param.h.
|
inlineslot |
Definition at line 44 of file kis_signal_compressor_with_param.h.
|
private |
Definition at line 49 of file kis_signal_compressor_with_param.h.