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
Regular Contributor
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel

Clicking on SystemDialog button closes the app

Below is a code that displays a dialog after certain operation in my app.... but when I click the OK button, the app comes out of the event loop and my app exits...

 

is there something I am missing...

 

I also tried to use show, instead of exec in the below code... but when show is used then app exits without the dialog itself . Smiley Sad

 

 

 

SystemDialog *dialog = new SystemDialog("OK");

    dialog->setDismissAutomatically(false);
    dialog->setTitle("My APP");
    dialog->setBody(" You are Done");
    dialog->show();
    dialog->deleteLater();

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Clicking on SystemDialog button closes the app

If you comment out deleteLater() does it still crash?

Do you use SystemToast in application? There's a known bug in beta5 - they don't work together with SystemDialog.

Andrey Fidrya, @zmeyc on twitter
Regular Contributor
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel

Re: Clicking on SystemDialog button closes the app

If you comment out deleteLater() does it still crash? : YES

 

I am also using SystemProgressDialog in my app.

 

-thanks

 

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Clicking on SystemDialog button closes the app

Can you please try commenting out SystemProgressDialog temporarily? This might be the same bug.

Is there any code between "new SystemDialog()" and "setDismiss..."?
Try to determine the exact line it crashes by stepping through code with debugger or adding qDebug()'s, for ex.:
qDebug() << "line1\n"; // \n to flush output every line

Andrey Fidrya, @zmeyc on twitter
Regular Contributor
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel

Re: Clicking on SystemDialog button closes the app

Commenting usage of SystemProgressDialog resolves the issue... but how to show progress Smiley Sad in my app?
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Clicking on SystemDialog button closes the app

This seems to be unsolved yet. Threads like this are still opened:

http://supportforums.blackberry.com/t5/Cascades-Development/SystemDialog-SystemProgressDialog-freeze...

 

Workarounds probably won't be simple. Something like creating a container with absolute positioning on top of other controls for example.

 


Andrey Fidrya, @zmeyc on twitter