[Qt-interest] Asynchronous quitting of Symbian application
Yuvraaj Kelkar
yuvraaj at gmail.com
Wed Sep 28 14:30:43 CEST 2011
If you unset Qt::WA_QuitOnClose, then you should be able to get close
events and then chose whether to really close or not.
http://doc.qt.nokia.com/4.7/qwidget.html#close
On Wed, Sep 28, 2011 at 2:55 AM, Bo Elmgreen <bo.elmgreen at gmail.com> wrote:
> Hi all,
>
> Well, I have now tried out different suggestions, but unfortunately none
> of them worked for me. I tried to listen to the QWidget::closeEvent(),
> but as far as I have been able to find out, this one is only called if
> the user presses the default exit (right) soft key. As I have set up my
> own action for the right soft key, closeEvent() is not called. And when
> the application is closed from the task manager, closeEvent() is not
> supposed to be called at all, as the "UI has already been torn down by
> the UI framework", see:
> http://qt.gitorious.org/qt-labs/nacl/commit/8aec69a/diffs.
>
> Another suggestion was to use the Session Management framework, but as
> far as I can determine, it is not enabled by default on the Symbian
> platform. At least, if you override the appropriate methods in your
> derived QApplication, they are not called when closing the application.
>
> There was a suggestion in the qt.gitorious link above to re-implement
> the platform specific event filter, in order to catch the EEikCmdExit
> command. If I find time, I will give that a try.
>
> Cheers,
> Bo
>
> On 27/09/2011 16:49, Bo Elmgreen wrote:
>> Hi Pritam,
>>
>> That indeed looks like what I was searching for. Thanks!
>>
>> BR,
>> Bo
>>
>> On 27/09/2011 16:22, Pritam Ghanghas wrote:
>>> On Tue, 2011-09-27 at 17:16 +0530, Bo Elmgreen wrote:
>>>> Hi all,
>>>>
>>>> I am developing an application for Symbian and I have come across a
>>>> problem, where I could use some advice :-)
>>>>
>>>> My application is divided in two: A (widget-based) UI part and some
>>>> "middleware" components, that run in their own (Q)Thread, that
>>>> communicate with some servers over a data connection. The communication
>>>> between the UI and the middleware is done via signals and slots.
>>>>
>>>> The problem arises, when it is time to quit the application in a
>>>> special
>>>> situation. If the user selects the "Exit" option in the UI, the UI
>>>> components can dispose of the middleware and exit the application when
>>>> the middleware has signalled that this has completed. But if the
>>>> application is closed from the task manager, the application will not
>>>> know what is happening before either 1) the main window destructor is
>>>> called or 2) it listens to the aboutToQuit signal. But in both cases it
>>>> appears as though the application has to quit synchronously, leaving me
>>>> with the problem that I cannot wait for the middleware to exit
>>>> properly :-(
>>>>
>>>> I guess that I am not the only one having this kind of design, so
>>>> how is
>>>> this situation "normally" handled?
>>> Look at documentation of QWidget::closeEvent().
>>> handle this event and quit when you are ready.
>>>
>>>> Thanks in advance!
>>>>
>>>> Best Regards,
>>>> Bo
>>>>
>>>> _______________________________________________
>>>> Qt-interest mailing list
>>>> Qt-interest at qt.nokia.com
>>>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>>
>>> **************** CAUTION - Disclaimer *****************
>>> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
>>> solely
>>> for the use of the addressee(s). If you are not the intended
>>> recipient, please
>>> notify the sender by e-mail and delete the original message. Further,
>>> you are not
>>> to copy, disclose, or distribute this e-mail or its contents to any
>>> other person and
>>> any such actions are unlawful. This e-mail may contain viruses.
>>> Infosys has taken
>>> every reasonable precaution to minimize this risk, but is not liable
>>> for any damage
>>> you may sustain as a result of any virus in this e-mail. You should
>>> carry out your
>>> own virus checks before opening the e-mail or attachment. Infosys
>>> reserves the
>>> right to monitor and review the content of all messages sent to or
>>> from this e-mail
>>> address. Messages sent to or from this e-mail address may be stored
>>> on the
>>> Infosys e-mail system.
>>> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at qt.nokia.com
>>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list