diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-12-11 23:13:12 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:21 -0300 |
commit | 7bfbbf3cb784f8e22dde74ebe28ba5e5eda4b7db (patch) | |
tree | 0bd9c001bd2d6ff30f34c39aaf1a28c6233ffb43 /PySide/QtCore/qchar_conversions.h | |
parent | aec20b21a5cfc678c8bd1e017d2300542edfbce7 (diff) |
No more training wheels. The last occurrences of the old template Converter where removed.
Also related fixes here and there.
Diffstat (limited to 'PySide/QtCore/qchar_conversions.h')
-rw-r--r-- | PySide/QtCore/qchar_conversions.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/PySide/QtCore/qchar_conversions.h b/PySide/QtCore/qchar_conversions.h deleted file mode 100644 index f79bac3c7..000000000 --- a/PySide/QtCore/qchar_conversions.h +++ /dev/null @@ -1,35 +0,0 @@ -namespace Shiboken { - -template<> -struct Converter<QChar> -{ - static bool checkType(PyObject* pyObj) - { - return Shiboken::String::check(pyObj) && (Shiboken::String::len(pyObj) == 1); - } - - static bool isConvertible(PyObject* pyObj) - { - return (Shiboken::String::check(pyObj) && (Shiboken::String::len(pyObj) == 1)) - || pyObj == Py_None - || PyInt_Check(pyObj); - } - - static QChar toCpp(PyObject* pyObj) - { - if (Shiboken::String::check(pyObj) && (Shiboken::String::len(pyObj) == 1)) - return QChar(Shiboken::Converter<char >::toCpp(pyObj)); - else if (PyInt_Check(pyObj)) - return QChar(Shiboken::Converter<int >::toCpp(pyObj)); - return QChar(); - } - - static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast<QChar*>(cppObj)); } - static PyObject* toPython(const QChar& cppObj) - { - wchar_t c = (wchar_t)cppObj.unicode(); - PyObject* pyObj = PyUnicode_FromWideChar(&c, 1); - return pyObj; - } -}; -} |