eric6/WebBrowser/ZoomManager/ZoomValuesDialog.py

changeset 7270
41d09cf20415
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7269:0c63ea7f94bd 7270:41d09cf20415
55 """ 55 """
56 Private method to calculate the section sizes of the horizontal header. 56 Private method to calculate the section sizes of the horizontal header.
57 """ 57 """
58 fm = QFontMetrics(QFont()) 58 fm = QFontMetrics(QFont())
59 for section in range(self.__zoomValuesModel.columnCount()): 59 for section in range(self.__zoomValuesModel.columnCount()):
60 header = self.zoomValuesTable.horizontalHeader()\ 60 header = self.zoomValuesTable.horizontalHeader().sectionSizeHint(
61 .sectionSizeHint(section) 61 section)
62 if section == 0: 62 if section == 0:
63 header = fm.width("extraveryveryverylongsitename") 63 header = fm.width("extraveryveryverylongsitename")
64 elif section == 1: 64 elif section == 1:
65 header = fm.width("averagelongzoomvalue") 65 header = fm.width("averagelongzoomvalue")
66 buffer = fm.width("mm") 66 buffer = fm.width("mm")
67 header += buffer 67 header += buffer
68 self.zoomValuesTable.horizontalHeader()\ 68 self.zoomValuesTable.horizontalHeader().resizeSection(
69 .resizeSection(section, header) 69 section, header)
70 self.zoomValuesTable.horizontalHeader().setStretchLastSection(True) 70 self.zoomValuesTable.horizontalHeader().setStretchLastSection(True)

eric ide

mercurial