Example #1
0
 def drawText(self, p):
     sz = self._text_rf.size() * float(self.sty['Text']['scale'])
     base.adjustFontSize(p, self.text, sz)
     p.setPen(QColor(*list(self.sty['Text']['color'])))
     if __debug__ and piony.G_DEBUG_VISUALS:
         p.drawRect(self._text_rf)
     if self.text and self._text_rf:
         p.drawText(self._text_rf, Qt.AlignCenter, self.text)
Example #2
0
    def drawSegmentText(self, p):
        ## RFC: Move to setGeometry. BUG: 'self' instead 'p' causes circular call
        sz = self.gText.size() * float(self.sty['Text']['scale'])
        base.adjustFontSize(p, self.text(), sz)

        p.setPen(self._clr("Text"))
        if __debug__ and piony.G_DEBUG_VISUALS:
            p.drawRect(self.gText)
        p.drawText(self.gText, Qt.AlignCenter, self.text())
Example #3
0
    def drawSegmentText(self, p):
        ## RFC: Move to setGeometry. BUG: 'self' instead 'p' causes circular call
        sz = self.gText.size() * float(self.sty['Text']['scale'])
        base.adjustFontSize(p, self.text(), sz)

        p.setPen(self._clr("Text"))
        if __debug__ and piony.G_DEBUG_VISUALS:
            p.drawRect(self.gText)
        p.drawText(self.gText, Qt.AlignCenter, self.text())
Example #4
0
    def drawText(self, p):
        sz = self._text_rf.size() * float(self.sty['Text']['scale'])
        base.adjustFontSize(p, self.sgm.name, sz)

        p.setPen(self._clr("Text"))
        if __debug__ and piony.G_DEBUG_VISUALS:
            p.drawRect(self._text_rf)
        if self.sgm.name and self._text_rf:
            p.drawText(self._text_rf, Qt.AlignCenter, self.sgm.name)
Example #5
0
    def drawName(self, p):
        a = self.r * sqrt(2)
        sz = self.frameGeometry().size()
        tq = QRect(sz.width()/2 - a/2, sz.height()/2 - a/2, a, a)
        ## text_scale -- has effect only untill you fit bbox
        tsz = tq.size() * float(self.sty['Text']['scale'])
        base.adjustFontSize(self, self.name, tsz)

        p.setPen(QtGui.QColor(*list(self.sty['Text']['color'])))
        p.drawText(tq, Qt.AlignCenter, self.name)
Example #6
0
    def drawName(self, p):
        a = self.r * sqrt(2)
        sz = self.frameGeometry().size()
        tq = QRect(sz.width() / 2 - a / 2, sz.height() / 2 - a / 2, a, a)
        ## text_scale -- has effect only untill you fit bbox
        tsz = tq.size() * float(self.sty['Text']['scale'])
        base.adjustFontSize(self, self.name, tsz)

        p.setPen(QtGui.QColor(*list(self.sty['Text']['color'])))
        p.drawText(tq, Qt.AlignCenter, self.name)