[PyKDE] Quitting invokes crash handler

Jim Bublitz jbublitz at nwinternet.com
Fri Aug 30 00:05:21 BST 2002


On 29-Aug-02 Gordon Tyler wrote:
> Frederick Polgardy Jr wrote:
>>    a.connect(a, SIGNAL("lastWindowClosed()"), w.fileQuit)
 
> I would write the above line like this (wordwrapped for reading):

>      a.connect(a, SIGNAL("lastWindowClosed()"),
>          KApplication.kApplication(), SLOT("quit()"))

The original line is both correct and different in function from
your suggested rewrite. 'w.fileQuit' might actually do something
useful (like save files, cleanup, etc) in a real program.
 
> Isn't there a kApp global variable like there is qApp?

No, there isn't (in PyKDE; it exists in KDE), because it causes
problems between the sip generated code and gcc 2.96 on
RH/Mandrake. (I'm not sure if qApp exists in PyQt either - I
believe it was gone last time I checked, but I could be wrong).

There is a static method KApplication.kApplication() that returns
the same pointer as kApp, as used in your example above.


Jim




More information about the PyQt mailing list