[PyKDE] Quitting invokes crash handler
    Gordon Tyler 
    gordon at doxxx.net
       
    Fri Aug 30 20:51:00 BST 2002
    
    
  
Jim Bublitz wrote:
> 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.
But wouldn't that connection be referring to a slot on an instance that 
no longer exists? w is the only window, when it is closed, the 
lastWindowClosed signal is fired, but the instance that it connects to 
is gone. Or am I misunderstanding the lifecycle of the w instance?
Ciao,
Gordon
    
    
More information about the PyQt
mailing list