diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-04-26 17:58:45 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:15 -0300 |
commit | adac79f08bff1e299eb61a2341383350602b4505 (patch) | |
tree | f1b225378269662dd69dbb18e571901d452733be | |
parent | 74dc26aa7180f7df26c5b975d7cd6a0443d04d78 (diff) |
Fix bugs 776 and 777
Bug 776 - "Operator "QPolygon::operator<<(QPoint)" missing"
Bug 777 - "Operator "QPolygon::operator<<(QVector<QPoint>)" missing"
-rw-r--r-- | PySide/QtGui/typesystem_gui_common.xml | 18 | ||||
-rw-r--r-- | tests/QtGui/qpolygonf_test.py | 6 |
2 files changed, 20 insertions, 4 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index 50da93374..8882367f0 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -651,10 +651,20 @@ <modify-function signature="QPolygon(int, const int *)" remove="all"/> <!-- ### A QVector parameter, for no defined type, will generate wrong code. --> <modify-function signature="operator+=(QVector)" remove="all"/> - <!-- ### See bug 776 --> - <modify-function signature="operator<<(QPoint)" remove="all"/> - <!-- ### See bug 777 --> - <modify-function signature="operator<<(QVector<QPoint>)" remove="all"/> + <modify-function signature="operator<<(QPoint)"> + <inject-code> + // %FUNCTION_NAME() + *%CPPSELF << %1; + %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF); + </inject-code> + </modify-function> + <modify-function signature="operator<<(QVector<QPoint>)"> + <inject-code> + // %FUNCTION_NAME() + *%CPPSELF << %1; + %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF); + </inject-code> + </modify-function> <!-- ### --> </value-type> <value-type name="QPolygonF"> diff --git a/tests/QtGui/qpolygonf_test.py b/tests/QtGui/qpolygonf_test.py index 83e643c36..f842eb43b 100644 --- a/tests/QtGui/qpolygonf_test.py +++ b/tests/QtGui/qpolygonf_test.py @@ -18,5 +18,11 @@ class QPolygonFNotIterableTest(unittest.TestCase): self.assertEqual(int(point.y()), i) i += 1; + def testPolygonShiftOperators(self): + p = QPolygon() + self.assertEqual(len(p), 0) + p << QPoint(10, 20) << QPoint(20, 30) << [QPoint(20, 30), QPoint(40, 50)] + self.assertEqual(len(p), 4) + if __name__ == '__main__': unittest.main() |