Fix bugs 776 and 777

Bug 776 - "Operator "QPolygon::operator<<(QPoint)" missing"
Bug 777 - "Operator "QPolygon::operator<<(QVector<QPoint>)" missing"
This commit is contained in:
Hugo Parente Lima 2011-04-26 17:58:45 -03:00
commit 8d9bf59fb1
2 changed files with 20 additions and 4 deletions

View file

@ -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&lt;&lt;(QPoint)" remove="all"/>
<!-- ### See bug 777 -->
<modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
<modify-function signature="operator&lt;&lt;(QPoint)">
<inject-code>
// %FUNCTION_NAME()
*%CPPSELF &lt;&lt; %1;
%PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
</inject-code>
</modify-function>
<modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)">
<inject-code>
// %FUNCTION_NAME()
*%CPPSELF &lt;&lt; %1;
%PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
</inject-code>
</modify-function>
<!-- ### -->
</value-type>
<value-type name="QPolygonF">

View file

@ -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()