Fix bug#544 - "QtCore.QRect missing binding for method getCoords"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Lauro Moura <lauro.neto@openbossa.org>
This commit is contained in:
parent
d2d9f6bac9
commit
00bfc9ba7b
2 changed files with 95 additions and 5 deletions
|
|
@ -862,10 +862,48 @@
|
||||||
};
|
};
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-function signature="getCoords(int*,int*,int*,int*)const">
|
<modify-function signature="getCoords(int*,int*,int*,int*)const">
|
||||||
<remove/>
|
<modify-argument index="return">
|
||||||
|
<replace-type modified-type="PyObject" />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="2">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="3">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="4">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target">
|
||||||
|
int a, b, c, d;
|
||||||
|
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||||
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="getRect(int*,int*,int*,int*)const">
|
<modify-function signature="getRect(int*,int*,int*,int*)const">
|
||||||
<remove/>
|
<modify-argument index="return">
|
||||||
|
<replace-type modified-type="PyObject" />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="2">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="3">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="4">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target">
|
||||||
|
int a, b, c, d;
|
||||||
|
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||||
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
</value-type>
|
</value-type>
|
||||||
<value-type name="QRectF">
|
<value-type name="QRectF">
|
||||||
|
|
@ -881,8 +919,50 @@
|
||||||
</insert-template>
|
</insert-template>
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
<modify-function signature="getCoords(qreal*,qreal*,qreal*,qreal*)const" remove="all" />
|
<modify-function signature="getCoords(qreal*,qreal*,qreal*,qreal*)const">
|
||||||
<modify-function signature="getRect(qreal*,qreal*,qreal*,qreal*)const" remove="all" />
|
<modify-argument index="return">
|
||||||
|
<replace-type modified-type="PyObject" />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="2">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="3">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="4">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target">
|
||||||
|
qreal a, b, c, d;
|
||||||
|
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||||
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="getRect(qreal*,qreal*,qreal*,qreal*)const">
|
||||||
|
<modify-argument index="return">
|
||||||
|
<replace-type modified-type="PyObject" />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="2">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="3">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="4">
|
||||||
|
<remove-argument />
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target">
|
||||||
|
qreal a, b, c, d;
|
||||||
|
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||||
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
</value-type>
|
</value-type>
|
||||||
<value-type name="QSize" hash-function="PySide::hash">
|
<value-type name="QSize" hash-function="PySide::hash">
|
||||||
<add-function signature="__reduce__" return-type="PyObject*">
|
<add-function signature="__reduce__" return-type="PyObject*">
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from PySide.QtCore import QPoint, QRect
|
from PySide.QtCore import QPoint, QRect, QRectF
|
||||||
|
|
||||||
class RectConstructor(unittest.TestCase):
|
class RectConstructor(unittest.TestCase):
|
||||||
|
|
||||||
|
|
@ -97,6 +97,16 @@ class RectOperator(unittest.TestCase):
|
||||||
rect3 = rect1 | rect2
|
rect3 = rect1 | rect2
|
||||||
self.assertEqual(rect3, rect1)
|
self.assertEqual(rect3, rect1)
|
||||||
|
|
||||||
|
def testGetCoordsAndRect(self):
|
||||||
|
rect1 = QRect(1, 2, 3, 4)
|
||||||
|
self.assertEqual(rect1.getRect(), (1, 2, 3, 4))
|
||||||
|
self.assertEqual(rect1.getCoords(), (1, 2, 3, 5))
|
||||||
|
|
||||||
|
rect1 = QRectF(1, 2, 3, 4)
|
||||||
|
self.assertEqual(rect1.getRect(), (1, 2, 3, 4))
|
||||||
|
self.assertEqual(rect1.getCoords(), (1, 2, 4, 6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue