From 8d8c4cf308c6e066a4e625ff2a05c11e7b9fba0b Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Thu, 28 Jul 2011 16:37:12 -0300 Subject: Fix bug 923 - "Make QScriptValue (or QScriptValueIterator) implement the Python iterator protocol" Reviewer: Marcelo Lira Luciano Wolf --- PySide/QtScript/typesystem_script.xml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'PySide/QtScript/typesystem_script.xml') diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml index 738c44bda..05afba262 100644 --- a/PySide/QtScript/typesystem_script.xml +++ b/PySide/QtScript/typesystem_script.xml @@ -72,7 +72,28 @@ } + + + %PYARG_0 = Shiboken::createWrapper(new QScriptValueIterator(*%CPPSELF), true, true); + + - + + + + + + + + + if (%CPPSELF.hasNext()) { + %CPPSELF.next(); + %PYARG_0 = Shiboken::makeTuple(%CPPSELF.name(), %CPPSELF.value().toVariant()); + } else { + PyErr_SetNone(PyExc_StopIteration); + } + + + -- cgit v1.2.3