[PyKDE] Quitting invokes crash handler

Frederick Polgardy Jr polgardy at bodacion.com
Thu Aug 29 18:40:01 BST 2002


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()




More information about the PyQt mailing list