MIRA
|
Class that provides different slots with different parameters. More...
#include <widgets/SignalBinder.h>
Public Slots | |
void | slot () |
void | slot (int val) |
void | slot (const QString &val) |
Public Member Functions | |
SignalBinder (QObject *parent) | |
void | bind (boost::function< void()> f) |
binds the given function to the slot "slot()" More... | |
void | bindInt (boost::function< void(int)> f) |
binds the given function to the slot "slot(int)" More... | |
void | bindQString (boost::function< void(const QString &)> f) |
binds the given function to the slot "slot(const QString&)" More... | |
Static Public Member Functions | |
static SignalBinder * | connect (QObject *sender, const char *signal, boost::function< void()> function) |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified function. More... | |
template<typename Class > | |
static SignalBinder * | connect (QObject *sender, const char *signal, void(Class::*method)(), Class *instance) |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified 'method' of the given class 'instance'. More... | |
static SignalBinder * | connect (QObject *sender, const char *signal, boost::function< void(int)> function) |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified function. More... | |
template<typename Class > | |
static SignalBinder * | connect (QObject *sender, const char *signal, void(Class::*method)(int), Class *instance) |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified 'method' of the given class 'instance'. More... | |
static SignalBinder * | connect (QObject *sender, const char *signal, boost::function< void(const QString &)> function) |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified function. More... | |
template<typename Class > | |
static SignalBinder * | connect (QObject *sender, const char *signal, void(Class::*method)(const QString &), Class *instance) |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified 'method' of the given class 'instance'. More... | |
Class that provides different slots with different parameters.
For each such slot a boost function can be bound that is called if the slot is invoked. This mechanism can be used as workaround since Qt MOC is not able to handle templates.
Instead of Qt's connect: connect(button, SIGNAL(clicked()), this, SLOT(method());
you can use: SignalBinder::connect(button, SIGNAL(clicked()), &MyClass::method, this);
Example how to use arbitrary bound methods: SignalBinder* s = new SignalBinder(this); s.bind(myMethod); connect(someWidget,SIGNAL(someSignal(int)), s, SLOT(slot(int)));
|
inline |
|
inline |
binds the given function to the slot "slot()"
|
inline |
binds the given function to the slot "slot(int)"
|
inline |
binds the given function to the slot "slot(const QString&)"
|
inlineslot |
|
inlineslot |
|
inlineslot |
|
inlinestatic |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified function.
This variant is for method with the signature 'void method()'.
|
inlinestatic |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified 'method' of the given class 'instance'.
This variant is for method with the signature 'void method()'.
|
inlinestatic |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified function.
This variant is for method with the signature 'void method(int)'.
|
inlinestatic |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified 'method' of the given class 'instance'.
This variant is for method with the signature 'void method(int)'.
|
inlinestatic |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified function.
This variant is for method with the signature 'void method(const QString&)'.
|
inlinestatic |
Create a SignalBinder instance and binds the specified 'signal' of the 'sender' to the specified 'method' of the given class 'instance'.
This variant is for method with the signature 'void method(const QString&)'.