diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-04-13 20:54:00 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:10 -0300 |
commit | 000a3232453a64922eab53ec496c361aed365b49 (patch) | |
tree | 68fa6e895b73f7c2a4885d41306c675a845f0cc4 /PySide | |
parent | 6f981476023030723bbad15751bb053a5be60c4c (diff) |
Implemented support to mapping on QMatrix4x4.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtGui/typesystem_gui_common.xml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index d06502f60..a3043bcd1 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -6189,6 +6189,24 @@ <modify-function signature="data() const" remove="all"/> <modify-function signature="constData() const" remove="all"/> <!-- ### --> + <modify-function signature="operator()(int, int) const" remove="all"/> + <modify-function signature="operator()(int, int)" remove="all"/> + <add-function signature="__mgetitem__" return-type="PyObject*"> + <inject-code> + if (PySequence_Check(_key)) { + Shiboken::AutoDecRef key(PySequence_Fast(_key, "Invalid matrix index.")); + if (PySequence_Fast_GET_SIZE(key.object()) == 2) { + PyObject* posx = PySequence_Fast_GET_ITEM(key.object(), 0); + PyObject* posy = PySequence_Fast_GET_ITEM(key.object(), 1); + Py_ssize_t x = PyInt_AsSsize_t(posx); + Py_ssize_t y = PyInt_AsSsize_t(posy); + return %CONVERTTOPYTHON[qreal]((*%CPPSELF)(x,y)); + } + } + PyErr_SetString(PyExc_IndexError, "Invalid matrix index."); + return 0; + </inject-code> + </add-function> </value-type> <object-type name="QGesture"> |