dashboard: kill the Qt built-in main window closing mechanism

When the main window is closed, Qt makes QApplication.exec() return, which conflicts with Quamash's implementation of loop.run_until_complete(). The conflict causes Quamash's run_forever() to return earlier than it should, and cause "RuntimeError('Event loop stopped before Future completed.')".

Closes #475
This commit is contained in:
Sebastien Bourdeauducq 2016-07-01 18:39:26 +08:00
parent ea13d00087
commit 11930228fd
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ class MainWindow(QtWidgets.QMainWindow):
self.exit_request = asyncio.Event() self.exit_request = asyncio.Event()
def closeEvent(self, *args): def closeEvent(self, event):
event.ignore()
self.exit_request.set() self.exit_request.set()
def save_state(self): def save_state(self):