mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
fix crashes and corruption in column headers
set all columns to interactive at once to work around qt5 issues
This commit is contained in:
parent
f9d93fa888
commit
29026b08e2
1 changed files with 3 additions and 5 deletions
|
@ -717,11 +717,9 @@ by clicking on one on the left."""))
|
||||||
|
|
||||||
def setColumnSizes(self):
|
def setColumnSizes(self):
|
||||||
hh = self.form.tableView.horizontalHeader()
|
hh = self.form.tableView.horizontalHeader()
|
||||||
for i in range(len(self.model.activeCols)):
|
hh.setResizeMode(QHeaderView.Interactive)
|
||||||
if hh.visualIndex(i) == len(self.model.activeCols) - 1:
|
hh.setResizeMode(hh.logicalIndex(len(self.model.activeCols)-1),
|
||||||
hh.setResizeMode(i, QHeaderView.Stretch)
|
QHeaderView.Stretch)
|
||||||
else:
|
|
||||||
hh.setResizeMode(i, QHeaderView.Interactive)
|
|
||||||
# this must be set post-resize or it doesn't work
|
# this must be set post-resize or it doesn't work
|
||||||
hh.setCascadingSectionResizes(False)
|
hh.setCascadingSectionResizes(False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue