aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/qstring_conversions.h
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-05 18:10:23 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-06 19:11:11 -0300
commita5b2237ee0a7a894e1eac4e2c0f4b270866a059a (patch)
tree22ced4e4a694f8ed9477fba2062e11806f3c2e7f /PySide/QtCore/qstring_conversions.h
parent826678cb91124784339c2a92118e82413ef03b5c (diff)
None is convertible to QString, the result is a QString where QString.isNull is true.
Diffstat (limited to 'PySide/QtCore/qstring_conversions.h')
-rw-r--r--PySide/QtCore/qstring_conversions.h3
1 files changed, 3 insertions, 0 deletions
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<QString>::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<QString>::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