Support QPoint(QPoint) constructor.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
1b943ab43c
commit
5bf7e701e7
2 changed files with 27 additions and 0 deletions
|
|
@ -1207,6 +1207,12 @@
|
||||||
</value-type>
|
</value-type>
|
||||||
|
|
||||||
<value-type name="QPoint">
|
<value-type name="QPoint">
|
||||||
|
<add-function signature="QPoint(PyObject*)">
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
%TYPE ptr = %CONVERTTOCPP[%TYPE](%PYARG_1);
|
||||||
|
cptr = new %TYPE(ptr.x(), ptr.y());
|
||||||
|
</inject-code>
|
||||||
|
</add-function>
|
||||||
<modify-function signature="rx()" remove="all"/>
|
<modify-function signature="rx()" remove="all"/>
|
||||||
<modify-function signature="ry()" remove="all"/>
|
<modify-function signature="ry()" remove="all"/>
|
||||||
</value-type>
|
</value-type>
|
||||||
|
|
|
||||||
21
tests/qtcore/qpoint_test.py
Normal file
21
tests/qtcore/qpoint_test.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
'''Test cases for QPoint and QPointF'''
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from PySide.QtCore import QPoint, QPointF
|
||||||
|
|
||||||
|
|
||||||
|
class QPointTest(unittest.TestCase):
|
||||||
|
|
||||||
|
def testQPointCtor(self):
|
||||||
|
point = QPoint(QPoint(10,20))
|
||||||
|
|
||||||
|
class QPointFTest(unittest.TestCase):
|
||||||
|
|
||||||
|
def testQPointFCtor(self):
|
||||||
|
pointf = QPointF(QPoint(10,20))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue