diff options
-rw-r--r-- | tests/QtGui/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtGui/qpolygonf_test.py | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index a26c1f615..c8db7a2b4 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -48,6 +48,7 @@ PYSIDE_TEST(qobject_mi_test.py) PYSIDE_TEST(qpainter_test.py) PYSIDE_TEST(qpen_test.py) PYSIDE_TEST(qpixmap_test.py) +PYSIDE_TEST(qpolygonf_test.py) PYSIDE_TEST(qpushbutton_test.py) PYSIDE_TEST(qradialgradient_test.py) PYSIDE_TEST(qregion_test.py) diff --git a/tests/QtGui/qpolygonf_test.py b/tests/QtGui/qpolygonf_test.py new file mode 100644 index 000000000..83e643c36 --- /dev/null +++ b/tests/QtGui/qpolygonf_test.py @@ -0,0 +1,22 @@ + +import unittest +from PySide.QtCore import * +from PySide.QtGui import * + +class QPolygonFNotIterableTest(unittest.TestCase): + """Test if a QPolygonF is iterable""" + def testIt(self): + p = QPolygonF(4) + self.assertEqual(len(p), 4) + + for i in range(0, 4): + p[i] = QPointF(float(i), float(i)) + + i = 0 + for point in p: + self.assertEqual(int(point.x()), i) + self.assertEqual(int(point.y()), i) + i += 1; + +if __name__ == '__main__': + unittest.main() |