コード例 #1
0
ファイル: Expressions.py プロジェクト: Caian/Asparagus
 def paint(self, painter, option, widget):
     pen = getDefaultExpressionPen()
     font = Shapes.getDefaultFont()
     brush = Shapes.getDefaultForeBrush()
     pen.setWidthF(2.0)
     painter.scale(1, -1)
     painter.setPen(pen)
     painter.setFont(font)
     painter.setBrush(brush)
     for i in self.tree:
         i.paint(painter, font, 0, 0);
コード例 #2
0
ファイル: Expressions.py プロジェクト: Caian/Asparagus
 def paint(self, painter, option, widget):
     pen = getDefaultExpressionPen()
     rpen = Shapes.getDefaultPen(True)
     font = Shapes.getDefaultFont()
     brush = Shapes.getDefaultForeBrush()
     m = getDefaultExpressionListMargin()
     b = self.boundingRect().adjusted(0, 0, m, m)
     pen.setWidthF(2.0)
     painter.scale(1, -1)
     painter.setPen(rpen)
     painter.setFont(font)
     painter.setBrush(self.bg)
     painter.drawRect(b)
     painter.setPen(pen)
     painter.setBrush(brush)
     h = m/2
     for i in self.tree:
         b = i.boundingRect(font)
         i.paint(painter, font, -b.left() + m/2, h + b.height()/2);
         h += b.height()