diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2010-02-18 17:26:37 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-19 18:43:46 -0300 |
commit | 5bf7e701e7f598287a460682ad4468a2460a9932 (patch) | |
tree | 23016b8885118a32b296e6d00340c3a405b3de0e | |
parent | 1b943ab43c730b28b7dc3acbdc8d6d5a737cf4ad (diff) |
Support QPoint(QPoint) constructor.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 6 | ||||
-rw-r--r-- | tests/qtcore/qpoint_test.py | 21 |
2 files changed, 27 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 5db287ae0..34c46a6d8 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1207,6 +1207,12 @@ </value-type> <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="ry()" remove="all"/> </value-type> diff --git a/tests/qtcore/qpoint_test.py b/tests/qtcore/qpoint_test.py new file mode 100644 index 000000000..dfce76939 --- /dev/null +++ b/tests/qtcore/qpoint_test.py @@ -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() + |