From 633bbc457db7140cef2aa8eba4d78e40f248d450 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 17 Mar 2016 13:20:29 +0800 Subject: [PATCH] gui/schedule: work around Qt bug when first row is inserted with due date. Closes #329 --- artiq/gui/schedule.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/artiq/gui/schedule.py b/artiq/gui/schedule.py index e7d0b26e8..7ff20553e 100644 --- a/artiq/gui/schedule.py +++ b/artiq/gui/schedule.py @@ -89,9 +89,17 @@ class ScheduleDock(QtWidgets.QDockWidget): self.table_model = Model(dict()) schedule_sub.add_setmodel_callback(self.set_model) + def rows_inserted_after(self): + # HACK: + # workaround the usual Qt layout bug when the first row is inserted + # (columns are undersized if an experiment with a due date is scheduled + # and the schedule was empty) + self.table.horizontalHeader().reset() + def set_model(self, model): self.table_model = model self.table.setModel(self.table_model) + self.table_model.rowsInserted.connect(self.rows_inserted_after) async def delete(self, rid, graceful): if graceful: