Exemplo n.º 1
0
 def tickLabel(self, font, value):
     lbl = self.__data.labelCache.get(value)
     if lbl is None:
         lbl = QwtText(self.label(value))
         lbl.setRenderFlags(0)
         lbl.setLayoutAttribute(QwtText.MinimumLayout)
         lbl.textSize(font)
         self.__data.labelCache[value] = lbl
     return lbl
Exemplo n.º 2
0
 def tickLabel(self, font, value):
     lbl = self.__data.labelCache.get(value)
     if lbl is None:
         lbl = QwtText(self.label(value))
         lbl.setRenderFlags(0)
         lbl.setLayoutAttribute(QwtText.MinimumLayout)
         lbl.textSize(font)
         self.__data.labelCache[value] = lbl
     return lbl
Exemplo n.º 3
0
    def tickLabel(self, font, value):
        """
        Convert a value into its representing label and cache it.

        The conversion between value and label is called very often
        in the layout and painting code. Unfortunately the
        calculation of the label sizes might be slow (really slow
        for rich text in Qt4), so it's necessary to cache the labels.

        :param QFont font: Font
        :param float value: Value
        :return: Tick label
        """
        lbl = self.__data.labelCache.get(value)
        if lbl is None:
            lbl = QwtText(self.label(value))
            lbl.setRenderFlags(0)
            lbl.setLayoutAttribute(QwtText.MinimumLayout)
            lbl.textSize(font)
            self.__data.labelCache[value] = lbl
        return lbl
Exemplo n.º 4
0
    def tickLabel(self, font, value):
        """
        Convert a value into its representing label and cache it.

        The conversion between value and label is called very often
        in the layout and painting code. Unfortunately the
        calculation of the label sizes might be slow (really slow
        for rich text in Qt4), so it's necessary to cache the labels.
        
        :param QFont font: Font
        :param float value: Value
        :return: Tick label
        """
        lbl = self.__data.labelCache.get(value)
        if lbl is None:
            lbl = QwtText(self.label(value))
            lbl.setRenderFlags(0)
            lbl.setLayoutAttribute(QwtText.MinimumLayout)
            lbl.textSize(font)
            self.__data.labelCache[value] = lbl
        return lbl