From 29026b08e2b871b210e7869a834677cf8f42278d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 14 Mar 2014 15:41:00 +0900 Subject: [PATCH] fix crashes and corruption in column headers set all columns to interactive at once to work around qt5 issues --- aqt/browser.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aqt/browser.py b/aqt/browser.py index 25380c78e..8ad8de788 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -717,11 +717,9 @@ by clicking on one on the left.""")) def setColumnSizes(self): hh = self.form.tableView.horizontalHeader() - for i in range(len(self.model.activeCols)): - if hh.visualIndex(i) == len(self.model.activeCols) - 1: - hh.setResizeMode(i, QHeaderView.Stretch) - else: - hh.setResizeMode(i, QHeaderView.Interactive) + hh.setResizeMode(QHeaderView.Interactive) + hh.setResizeMode(hh.logicalIndex(len(self.model.activeCols)-1), + QHeaderView.Stretch) # this must be set post-resize or it doesn't work hh.setCascadingSectionResizes(False)