Qt UI: fix main window closing for Mac OS X
Qt UI: fix main window closing for Mac OS X (final step)