From 11930228fd6b8a2445f3ae4a9729568bfd2c2ab6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 1 Jul 2016 18:39:26 +0800 Subject: [PATCH] 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 --- artiq/frontend/artiq_dashboard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/frontend/artiq_dashboard.py b/artiq/frontend/artiq_dashboard.py index 3c9dbf080..aabd1b6f5 100755 --- a/artiq/frontend/artiq_dashboard.py +++ b/artiq/frontend/artiq_dashboard.py @@ -59,7 +59,8 @@ class MainWindow(QtWidgets.QMainWindow): self.exit_request = asyncio.Event() - def closeEvent(self, *args): + def closeEvent(self, event): + event.ignore() self.exit_request.set() def save_state(self):