![]() |
![]() |
Compounds | |
class | slot |
Convenience wrapper for the numbered sigc::slot# templates. More... | |
class | slot0 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot1 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot2 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot3 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot4 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot5 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot6 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot7 |
Converts an arbitrary functor to a unified type which is opaque. More... | |
class | slot_base |
Base type for slots. More... |
A Slot can be constructed from any function, regardless of whether it is a global function, a member method, static, or virtual.
Use the sigc::mem_fun() and sigc::ptr_fun() template functions to get a sigc::slot, like so:
sigc::slot<void, int> sl = sigc::mem_fun(someobj,& SomeClass::somemethod);
or
sigc::slot<void, int> sl = sigc::ptr_fun(&somefunction);
or
m_Button.signal_clicked().connect( sigc::mem_fun(*this, &MyWindow::on_button_clicked) );
The compiler will complain if SomeClass::somemethod, etc. have the wrong signature.
You can also pass slots as method parameters where you might normally pass a function pointer.