本文整理汇总了Python中PyQt4.QtGui.QGraphicsPathItem.paint方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsPathItem.paint方法的具体用法?Python QGraphicsPathItem.paint怎么用?Python QGraphicsPathItem.paint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGraphicsPathItem
的用法示例。
在下文中一共展示了QGraphicsPathItem.paint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: paint
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import paint [as 别名]
def paint( self, painter, option, widget ):
""" Draws a curve and then adds an arrow """
pen = QPen( QColor( 0, 0, 0) )
pen.setWidth( 2 )
self.setPen( pen )
painter.setRenderHint( QPainter.Antialiasing, True )
QGraphicsPathItem.paint( self, painter, option, widget )
return
示例2: paint
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import paint [as 别名]
def paint( self, painter, option, widget ):
color = self.__settings.lineColor
if self.penColor:
color = self.penColor
width = self.__settings.lineWidth
if self.penWidth:
width = self.penWidth
pen = QPen( color )
pen.setWidth( width )
pen.setCapStyle( Qt.FlatCap )
pen.setJoinStyle( Qt.RoundJoin )
if self.penStyle:
pen.setStyle( self.penStyle )
self.setPen( pen )
QGraphicsPathItem.paint( self, painter, option, widget )
return