added QtGui.QMainWindow.closeEvent() to make sure the close event
cascades up properly.

issue #1676