Changeset b893fddd9692…
Parent 9feec9e8e2bf…
by
Changes to one file · Browse files at b893fddd9692 Showing diff from parent 9feec9e8e2bf Diff from another changeset...
@@ -188,9 +188,16 @@ def resizeColumns(self, *args):
# resize columns the smart way: the column holding Log
# is resized according to the total widget size.
+ if not self.model():
+ return
+ hh = self.horizontalHeader()
+ hh.setStretchLastSection(False)
+ self._resizeColumns()
+ hh.setStretchLastSection(True)
+
+ def _resizeColumns(self):
+ # _resizeColumns misbehaves if called with last section streched
model = self.model()
- if not model:
- return
col1_width = self.viewport().width()
fontm = QFontMetrics(self.font())
tot_stretch = 0.0
@@ -213,7 +220,6 @@ if model._columns[c] in model._stretchs:
w = model._stretchs[model._columns[c]] / tot_stretch
self.setColumnWidth(c, col1_width * w)
- #self.horizontalHeader().setStretchLastSection(True)
def revFromindex(self, index):
if not index.isValid():
|
Loading...