Added test for bug #395 - error calling QPainter.drawLines overloads.

Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Reviewed by Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
Marcelo Lira 2010-10-19 18:09:53 -03:00
commit e733c2b11b

View file

@ -1,7 +1,7 @@
import unittest import unittest
from PySide.QtGui import QPainter, QBrush, QLinearGradient from PySide.QtGui import QPainter, QLinearGradient
from PySide.QtCore import QRect, QRectF, Qt from PySide.QtCore import QLine, QLineF, QPoint, QPointF, QRect, QRectF, Qt
class QPainterDrawText(unittest.TestCase): class QPainterDrawText(unittest.TestCase):
@ -36,6 +36,14 @@ class QPainterDrawText(unittest.TestCase):
self.assert_(isinstance(newRect, QRectF)) self.assert_(isinstance(newRect, QRectF))
def testDrawLinesOverloads(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))])
class SetBrushWithOtherArgs(unittest.TestCase): class SetBrushWithOtherArgs(unittest.TestCase):
'''Using qpainter.setBrush with args other than QBrush''' '''Using qpainter.setBrush with args other than QBrush'''