示例#1
0
 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())
示例#2
0
 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()
示例#3
0
    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()