Call resizeEvent before resizing column for completion

This commit is contained in:
Florian Bruhin 2014-02-01 22:03:06 +01:00
parent b6126a49a9
commit 0adf8d6b53

View File

@ -92,6 +92,7 @@ class CompletionView(QTreeView):
e -- The QResizeEvent.
"""
super().resizeEvent(e)
width = e.size().width()
cols = self.model.columnCount()
colwidth = int(width / cols)
@ -101,7 +102,6 @@ class CompletionView(QTreeView):
assert colwidth > 1
for i in range(cols):
self.setColumnWidth(i, colwidth)
super().resizeEvent(e)
def setmodel(self, model):
"""Switch completion to a new model.