[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] After MessageBox app quits...why?
From: Demosthenes Koptsis <demosthenesk () gmail ! com>
Date: 2016-10-27 21:00:41
Message-ID: 46e9b3f7-47dc-7094-bf28-7b4f99494200 () gmail ! com
[Download RAW message or body]
Yes, David i found it a bit later...
Thanks for your reply
Regards
Dim
On 10/27/2016 11:41 PM, David Boddie wrote:
> On Thu Oct 27 18:20:05 BST 2016, Demosthenes Koptsis wrote:
>
>> Hello, i have a PyQT systray app with a menu and two actions.
>>
>> Action1 is Exit and action2 display a MessageBox with Hello World message.
>>
>> When i click OK to MessageBox app quits...why?
> It's due to an obscure feature of QApplication that, by default, exits the
> application when the last window is closed. You can turn it off in your
> program by calling
>
> app.setQuitOnLastWindowClosed(False)
>
> after you create the QApplication instance.
>
> The feature was introduced to prevent certain kinds of applications from
> lurking in the background after all their windows had been closed. In your
> case, you create a window but never open it, so I expect QApplication just
> treats the message box as the only window that the application uses.
>
> David
> _______________________________________________
> PyQt mailing list PyQt@riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic