def minimumLabelHeight(self): """ Returns the minimum height that will be required based on this font size and labels list. """ metrics = QFontMetrics(self.labelFont()) return max(self._minimumLabelHeight, metrics.height() + self.verticalLabelPadding())
def maxNotchSize( self, orientation ): """ Returns the maximum size for this ruler based on its notches and the given orientation. :param orientation | <Qt.Orientation> :return <int> """ metrics = QFontMetrics(QApplication.font()) if orientation == Qt.Vertical: notch = '' for n in self.notches(): if len(nativestring(n)) > len(nativestring(notch)): notch = nativestring(n) return metrics.width(notch) else: return metrics.height()
def maxNotchSize(self, orientation): """ Returns the maximum size for this ruler based on its notches and the given orientation. :param orientation | <Qt.Orientation> :return <int> """ metrics = QFontMetrics(QApplication.font()) if orientation == Qt.Vertical: notch = '' for n in self.notches(): if len(nativestring(n)) > len(nativestring(notch)): notch = nativestring(n) return metrics.width(notch) else: return metrics.height()