I'm creating multiple (undefined at design time) number of buttons programatically. How can I determine which button was clicked in my handler?
for (int i = 0; i < XXX; i++) {
Button *btn = Button::create();
QObject::connect(btn, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
...
}
void MyClass::onButtonClicked() {
???? Which button ???
}
On all platforms I'v previously used (Borland.VCL, Cocoa, Cocoa Touch, WinRT/PRT, Android...) event handler always(!!!) has a sender parameter indicating the object instance invoked the event.
So, how to do it in BlackBerry Cascades?
PS. Pleas don't tell me I have to create my own Subclass of Button, add a SIGNAL onClicked(MyButton *sender) and propagate it... This will end my BlackBerry development in it's early beginning. :)