diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-18 17:42:44 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-18 18:00:49 -0200 |
commit | ae55152a9255cc20dc44332d456ae944848ed212 (patch) | |
tree | b145ae7d9ab0fb2397e5cf8b5b6952cdec6c84f3 /PySide/QtCore/qlist_conversions.h | |
parent | 48bea29fd6b88f25810783502f3f5db74f1847fc (diff) |
Remove redundant code on containers custom conversions.
Diffstat (limited to 'PySide/QtCore/qlist_conversions.h')
-rw-r--r-- | PySide/QtCore/qlist_conversions.h | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/PySide/QtCore/qlist_conversions.h b/PySide/QtCore/qlist_conversions.h index 7430c615d..4ccfbe5cf 100644 --- a/PySide/QtCore/qlist_conversions.h +++ b/PySide/QtCore/qlist_conversions.h @@ -1,28 +1,2 @@ -template <typename qlist> -struct Converter_qlist -{ - static bool isConvertible(PyObject* pyobj) { - return PySequence_Check(pyobj); - } - - static PyObject* toPython(const qlist& list) - { - PyObject* result = PyList_New(list.size()); - for (int i = 0; i < list.size(); i++) { - PyList_SET_ITEM(result, i, Converter<typename qlist::value_type>::toPython(list.at(i))); - } - return result; - } - static qlist toCpp(PyObject* pyobj) - { - qlist result; - for (int i = 0; i < PySequence_Size(pyobj); i++) { - PyObject* pyItem = PySequence_GetItem(pyobj, i); - result.append(Converter<typename qlist::value_type>::toCpp(pyItem)); - } - return result; - } -}; - template<typename T> -struct Converter<QList<T> > : Converter_qlist<QList<T> > {}; +struct Converter<QList<T> > : Converter_std_list<QList<T> > {}; |