[PyKDE] Quitting invokes crash handler

Frederick Polgardy Jr polgardy at bodacion.com
Thu Aug 29 19:16:00 BST 2002


Fascinating.  If I add a 'w = None' after returning from a.exec_loop(), the 
crash problem goes away....  It's also interesting that this wasn't 
happening with Python 2.1.3 yesterday (the Debian packages for 2.2 were 
uploaded last night).

Ideas?

Fred

On Thursday 29 August 2002 11:38 am, Frederick Polgardy Jr wrote:
> Can anyone explain to me why, in the following app, choosing Quit from
> the File menu invokes the crash handler, but closing the window
> terminates gracefully?  Is there something about KDE or Python I'm
> unaware of?
>
> Thanks in advance,
> Fred
>
> Relevant versions:
>
> KDE 3.0.3
> Python 2.2.1
> SIP/PyQT/PyKDE 3.3.2
>
> Code snippet:
>
> import sys
> from qt import SIGNAL, QObject
> from kdecore import KCmdLineArgs, KApplication
> from kdeui import KMainWindow, KPopupMenu, KActionCollection, KStdAction
>
> class stuff(KMainWindow):
>    def __init__(self, parent = None, name = None, fl = 0):
>       KMainWindow.__init__(self, parent, name, fl)
>
>       # create a status bar
>       self.statusBar()
>
>       # create the menubar
>       fileMenu = KPopupMenu(self)
>       actionCollection = KActionCollection(self)
>       quitAction = KStdAction.quit(self.fileQuit, actionCollection)
>       quitAction.plug(fileMenu)
>       self.menuBar().insertItem(self.trUtf8("&File"), fileMenu)
>
>    def fileQuit(self):
>       print "About to quit..."
>       KApplication.kApplication().quit()
>
> if __name__ == "__main__":
>    KCmdLineArgs.init(sys.argv, "stuff", "Crash Test", "0.1")
>    a = KApplication()
>    w = stuff()
>    w.show()
>    a.setMainWidget(w)
>    a.connect(a, SIGNAL("lastWindowClosed()"), w.fileQuit)
>    a.exec_loop()
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.gmd.de
> http://mats.gmd.de/mailman/listinfo/pykde

-- 

F R E D E R I C K   P O L G A R D Y   J R.
Bodacion Technologies - A Virtual Media Company
18-3 E Dundee Road - Suite 300 - Barrington, IL 60010
Phone: 847/842.9008 - Fax: 847/842-1731
Web: http://www.bodacion.com




More information about the PyQt mailing list