02-28-2013 12:10 PM
Can't seem to find any doc on how to properly connect the finished signal.
I have this for the notificationdialog in my c file
bool success = QObject::connect(pNotification,
SIGNAL(finished(bb:
latform::NotificationResult::ButtonSelection*)),
this,
SLOT(onSelected(bb:
latform::NotificationResult::ButtonSelection*)));
void myApp:
nSelected(bb:
latform::NotificationResult *button)
{
}
in my h file i have this
public Q_SLOTS:
void onSelected(bb:
latform::NotificationResult *button);
what is the proper way to connect this? thanks
Solved! Go to Solution.
02-28-2013 01:30 PM - edited 02-28-2013 01:33 PM
Hi,
Please try the following:
#include <bb/platform/NotificationDialog> using namespace bb::platform; NotificationDialog *pNotification = .....;
[...]
QObject::connect(pNotification, SIGNAL(finished(bb::platform::NotificationResult::Type)), this, SLOT(onSelected(bb::platform::NotificationResult:: Type));
[...]
void myApp::onSelected(bb::platform::NotificationResult::Type value)
{
...
}
Use buttonSelection() function to get the selected button in signal's handler:
NotificationDialog *dialog = qobject_cast<NotificationDialog *>(sender()); // or reference a member variable directly
if (dialog)
{
SystemUiButton *button = dialog->buttonSelection();
...
}
02-28-2013 02:17 PM
For clearly answer:
#include <bb/platform/NotificationDialog> using namespace bb::platform; NotificationDialog *pNotification = .....;
[...]
QObject::connect(pNotification, SIGNAL(finished(bb::platform::NotificationResult::Type)), this, SLOT(onSelected(bb::platform::NotificationResult:: Type));
[...]
void myApp::onSelected(bb::platform::NotificationResult::Type value)
{ NotificationDialog *dialog = qobject_cast<NotificationDialog *>(sender()); // or reference a member variable directly if (dialog) { SystemUiButton *button = dialog->buttonSelection(); ... }
02-28-2013 02:35 PM
Thanks guys. ![]()
03-01-2013 07:47 AM