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: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Handling exit() events with Qt/C++?

Is there anything special I need to do to handle an exit event from BB10 when using Qt/C++? (i.e. when the user clicks the close app 'X' button from the navigator window)

 

At the moment the window closes, the icon becomes transparent but the process remains and has to be terminated via the IDE.

 

If I implement an exit button from within my app it exits gracefully with no issues (but I still need to handle closing the app via the navigator).

 

I'm using Qt/C++.

 

Thanks in advance.

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Handling exit() events with Qt/C++?

[ Edited ]

It should terminate automatically. Nothing special needs to be done.

When you run the application without debugger does it exit instantly? If the icon remains transparent for longer than half a second then most likely you're not releasing all resources properly.

Can you please try this with new project created from a template to see if it shows the same behavior?

 

Sorry, I thought you were using Cascades.

 


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: Handling exit() events with Qt/C++?

[Note I also posted this here]

 

I think this Qt/C++ BB10 example may hold some clues:

 

https://github.com/spstarr/qt-pictureflow-bb10/blob/master/pictureflow-qt/main.cpp

 

It connects the signals lastWindowClosed() and aboutToQuit() to the quit() slot:

 

  app->connect( app, SIGNAL(lastWindowClosed()), app, SLOT(quit()) );
  app->connect( app, SIGNAL(aboutToQuit()), app, SLOT(quit()) );

I've tried adding this to my app, but it hasn't yet made a difference - I'm convinced this has something to do with it, so I'm going to try pursuing this route for now.

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: Handling exit() events with Qt/C++?

Have raised this as a bug:

https://www.blackberry.com/jira/browse/BBTEN-678

 

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/