aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/qpolygonf_test.py
blob: 83e643c36196ed16bb5b3b440a3391786fa2ed6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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()