import sys

from qt import *
app=QApplication([])
class W(QWidget):
    def customEvent(self, e):
        print >> sys.stderr,'in event handler....'
        1/0 # gratuitous exception.... lets see how it gets handled
w = W()

print >> sys.stderr,'about to send event....'
app.sendEvent(w, QCustomEvent(QEvent.User))
print >> sys.stderr,'you should see an exception logged above\n\n'


print >> sys.stderr, 'about to post event, should see nothing yet....'
app.postEvent(w, QCustomEvent(QEvent.User))
print >> sys.stderr, 'about to process that event....'
app.processEvents()
print >> sys.stderr,'you *should* see the same exception logged again.'
print >> sys.stderr,'"Giovanni Bajo" <rasky@develer.com> reports that it is omitted\n\n'

print 'done'
