Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified
Accepted Solution

finished signal for a system toast?

[ Edited ]

Here

 

http://developer.blackberry.com/cascades/reference/bb__system__systemtoast.html#function-finished-va...

 

It says you can do something after the system toast is done.

 

I have a toast constructed and shown in a cpp function.

{...
bb::system::SystemToast *toast = new SystemToast(this);
toast->setBody("Yippie!");
toast->show();
...
}

How do I code so I can get that signal? I was dong java before so I'm a bit lost with cpp. I got the toast working in my app though. The QML calls the cpp function. So I want to do it all in cpp not in QML.

 

 

Developer
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10
My Carrier: Rogers

Re: finished signal for a system toast?

[ Edited ]

Try:

 

Somewhere in your hpp file...

 

#include <bb/system/SystemToast>
#include <bb/system/SystemUiResult>
public slots: void onSTFinished(bb::system::SystemUiResult::Type);

 

 

Somewhere in your cpp file...

 

 

#include <bb/system/SystemToast>
#include <bb/system/SystemUiResult>
using namespace bb::system;

....
....
bool res = connect(toast,
SIGNAL(finished(bb::system::SystemUiResult::Type)),
this,
SLOT(onSTFinished(bb::system::SystemUiResult::Type)));
Q_ASSERT(res);
Q_UNUSED(res);
....
....

void yourClass::onSTFinished(bb::system::SystemUiResult::Type uiResult)
{
// Do something with uiResult or ... another...
}
Highlighted
Developer
Posts: 196
Registered: ‎12-14-2009
My Device: Not Specified

Re: finished signal for a system toast?

[ Edited ]

Thank you. I was on the trail right as I got your reply studying signals and slots. 

 

Didn't have it all yet especially 

 

#include<bb/system/SystemUiResult>

 

Plugged the code in and worked first run. Thanks