An example of how to connect a member function to a KDBindings::Signal.
The output of this example is:
#include <iostream>
#include <string>
class Button
{
public:
Signal<> clicked;
};
class Message
{
public:
void display() const
{
std::cout << "Hello World!" << std::endl;
}
};
int main()
{
Button button;
Message message;
auto connection = button.clicked.connect(&Message::display, &message);
button.clicked.emit();
connection.disconnect();
return 0;
}
The main namespace of the KDBindings library.