Skip to content

Commit 633bbc4

Browse files
committedMar 17, 2016
gui/schedule: work around Qt bug when first row is inserted with due date. Closes #329
1 parent 61223fb commit 633bbc4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

Diff for: ‎artiq/gui/schedule.py

+8
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,17 @@ def __init__(self, status_bar, schedule_ctl, schedule_sub):
8989
self.table_model = Model(dict())
9090
schedule_sub.add_setmodel_callback(self.set_model)
9191

92+
def rows_inserted_after(self):
93+
# HACK:
94+
# workaround the usual Qt layout bug when the first row is inserted
95+
# (columns are undersized if an experiment with a due date is scheduled
96+
# and the schedule was empty)
97+
self.table.horizontalHeader().reset()
98+
9299
def set_model(self, model):
93100
self.table_model = model
94101
self.table.setModel(self.table_model)
102+
self.table_model.rowsInserted.connect(self.rows_inserted_after)
95103

96104
async def delete(self, rid, graceful):
97105
if graceful:

0 commit comments

Comments
 (0)