From a5b2237ee0a7a894e1eac4e2c0f4b270866a059a Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 5 Apr 2010 18:10:23 -0300 Subject: None is convertible to QString, the result is a QString where QString.isNull is true. --- PySide/QtCore/qstring_conversions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'PySide/QtCore') diff --git a/PySide/QtCore/qstring_conversions.h b/PySide/QtCore/qstring_conversions.h index d2edf9479..2c59928dd 100644 --- a/PySide/QtCore/qstring_conversions.h +++ b/PySide/QtCore/qstring_conversions.h @@ -7,6 +7,7 @@ inline bool Converter::isConvertible(PyObject* pyObj) || PyUnicode_Check(pyObj) || SbkQByteArray_Check(pyObj) || SbkQLatin1String_Check(pyObj) + || pyObj == Py_None #if PY_VERSION_HEX < 0x03000000 || (pyObj->ob_type->tp_as_buffer && PyType_HasFeature(pyObj->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER) @@ -35,6 +36,8 @@ inline QString Converter::toCpp(PyObject* pyObj) #endif } else if (PyString_Check(pyObj)) { return QString(Converter< char * >::toCpp(pyObj)); + } else if (pyObj == Py_None) { + return QString(); } #if PY_VERSION_HEX < 0x03000000 // Support for buffer objects on QString constructor -- cgit v1.2.3