[PyKDE] Quitting invokes crash handler
Frederick Polgardy Jr
polgardy at bodacion.com
Fri Aug 30 16:38:01 BST 2002
Jim,
FYI, the corresponding PyQt code doesn't crash, even with 1-character
variable names. ;-)
Fred
Relevant versions:
KDE 3.0.3
Python 2.2.1
SIP/PyQT/PyKDE 3.3.2
Code snippet:
import sys
from qt import *
class stuff(QMainWindow):
def __init__(self, parent = None, name = None, fl = 0):
QMainWindow.__init__(self, parent, name, fl)
# create a status bar
self.statusBar()
# create the menubar
fileMenu = QPopupMenu(self)
quitAction = QAction("Quit", "&Quit", 0, self)
QObject.connect(quitAction, SIGNAL("activated()"), self.fileQuit)
quitAction.addTo(fileMenu)
self.menuBar().insertItem("&File", fileMenu)
def fileQuit(self):
print "About to quit..."
qApp.quit()
if __name__ == "__main__":
a = QApplication(sys.argv)
w = stuff()
QObject.connect(a, SIGNAL("lastWindowClosed()"), w.fileQuit)
w.show()
a.exec_loop()
--
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