diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-11-30 16:00:57 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:20 -0300 |
commit | 770c8bda73f045ee2bd6261c0eca0c64cd12d2db (patch) | |
tree | 2e5c0b605f47b8df3b015ed15715e09f075fc8a7 /PySide | |
parent | 16f4378fed98a1bd1ef0dd6c4616aa4ce8fa016e (diff) |
Fixed custom code for QScriptValueIterator.__next__ function.
It must not use the convenience method Shiboken::makeTuple, for it makes
use of the old template based converters.
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtScript/typesystem_script.xml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml index af2f198c5..d787b22ab 100644 --- a/PySide/QtScript/typesystem_script.xml +++ b/PySide/QtScript/typesystem_script.xml @@ -98,12 +98,16 @@ </add-function> <add-function signature="__next__()" return-type="PyObject*"> <inject-code> - if (%CPPSELF.hasNext()) { - %CPPSELF.next(); - %PYARG_0 = Shiboken::makeTuple(%CPPSELF.name(), %CPPSELF.value().toVariant()); - } else { - PyErr_SetNone(PyExc_StopIteration); - } + if (%CPPSELF.hasNext()) { + %CPPSELF.next(); + QString name = %CPPSELF.name(); + QVariant value = %CPPSELF.value().toVariant(); + %PYARG_0 = PyTuple_New(2); + PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QString](name)); + PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QVariant](value)); + } else { + PyErr_SetNone(PyExc_StopIteration); + } </inject-code> </add-function> </object-type> |