Skip to content

Commit

Permalink
gui/schedule: work around Qt bug when first row is inserted with due …
Browse files Browse the repository at this point in the history
…date. Closes #329
sbourdeauducq committed Mar 17, 2016
1 parent 61223fb commit 633bbc4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions artiq/gui/schedule.py
Original file line number Diff line number Diff line change
@@ -89,9 +89,17 @@ def __init__(self, status_bar, schedule_ctl, schedule_sub):
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:

0 comments on commit 633bbc4

Please sign in to comment.