本文整理汇总了Python中PySide.QtGui.QPainter.drawPolyline方法的典型用法代码示例。如果您正苦于以下问题:Python QPainter.drawPolyline方法的具体用法?Python QPainter.drawPolyline怎么用?Python QPainter.drawPolyline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QPainter
的用法示例。
在下文中一共展示了QPainter.drawPolyline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QPainterDrawText
# 需要导入模块: from PySide.QtGui import QPainter [as 别名]
# 或者: from PySide.QtGui.QPainter import drawPolyline [as 别名]
class QPainterDrawText(unittest.TestCase):
def setUp(self):
self.painter = QPainter()
self.text = 'teste!'
def tearDown(self):
del self.text
del self.painter
def testDrawText(self):
# bug #254
rect = self.painter.drawText(100, 100, 100, 100,
Qt.AlignCenter | Qt.TextWordWrap,
self.text)
self.assert_(isinstance(rect, QRect))
def testDrawTextWithRect(self):
# bug #225
rect = QRect(100, 100, 100, 100)
newRect = self.painter.drawText(rect, Qt.AlignCenter | Qt.TextWordWrap,
self.text)
self.assert_(isinstance(newRect, QRect))
def testDrawTextWithRectF(self):
'''QPainter.drawText(QRectF, ... ,QRectF*) inject code'''
rect = QRectF(100, 52.3, 100, 100)
newRect = self.painter.drawText(rect, Qt.AlignCenter | Qt.TextWordWrap,
self.text)
self.assert_(isinstance(newRect, QRectF))
def testDrawOverloads(self):
'''Calls QPainter.drawLines overloads, if something is
wrong Exception and chaos ensues. Bug #395'''
self.painter.drawLines([QLine(QPoint(0,0), QPoint(1,1))])
self.painter.drawLines([QPoint(0,0), QPoint(1,1)])
self.painter.drawLines([QPointF(0,0), QPointF(1,1)])
self.painter.drawLines([QLineF(QPointF(0,0), QPointF(1,1))])
self.painter.drawPoints([QPoint(0,0), QPoint(1,1)])
self.painter.drawPoints([QPointF(0,0), QPointF(1,1)])
self.painter.drawConvexPolygon([QPointF(10.0, 80.0),
QPointF(20.0, 10.0),
QPointF(80.0, 30.0),
QPointF(90.0, 70.0)])
self.painter.drawConvexPolygon([QPoint(10.0, 80.0),
QPoint(20.0, 10.0),
QPoint(80.0, 30.0),
QPoint(90.0, 70.0)])
self.painter.drawPolygon([QPointF(10.0, 80.0),
QPointF(20.0, 10.0),
QPointF(80.0, 30.0),
QPointF(90.0, 70.0)])
self.painter.drawPolygon([QPoint(10.0, 80.0),
QPoint(20.0, 10.0),
QPoint(80.0, 30.0),
QPoint(90.0, 70.0)])
self.painter.drawPolyline([QPointF(10.0, 80.0),
QPointF(20.0, 10.0),
QPointF(80.0, 30.0),
QPointF(90.0, 70.0)])
self.painter.drawPolyline([QPoint(10.0, 80.0),
QPoint(20.0, 10.0),
QPoint(80.0, 30.0),
QPoint(90.0, 70.0)])