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) |