2015-02-12 22:06:29 +00:00
|
|
|
import sys
|
|
|
|
from PyQt4 import QtCore, QtGui
|
|
|
|
|
2015-02-06 21:10:15 +00:00
|
|
|
|
|
|
|
class MyObj():
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def __del__(self):
|
2015-02-07 18:32:58 +00:00
|
|
|
print "##### Destroyed ######"
|
2015-02-06 21:10:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
def parse():
|
|
|
|
o = MyObj()
|
|
|
|
raise Exception("Intentional Exception")
|
|
|
|
|
|
|
|
|
2015-02-12 22:06:29 +00:00
|
|
|
class Example(QtGui.QWidget):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(Example, self).__init__()
|
|
|
|
|
|
|
|
qbtn = QtGui.QPushButton('Raise', self)
|
|
|
|
qbtn.clicked.connect(parse)
|
|
|
|
|
|
|
|
self.setWindowTitle('Quit button')
|
|
|
|
self.show()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
|
|
|
ex = Example()
|
|
|
|
sys.exit(app.exec_())
|