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

issue #1676
PEP8 fix
Merge pull request #1678 from tacaswell/qt4_closeevent

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