diff options
Diffstat (limited to 'PySide/QtGui/glue/wid_conversions.h')
-rw-r--r-- | PySide/QtGui/glue/wid_conversions.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/PySide/QtGui/glue/wid_conversions.h b/PySide/QtGui/glue/wid_conversions.h new file mode 100644 index 000000000..9901218a1 --- /dev/null +++ b/PySide/QtGui/glue/wid_conversions.h @@ -0,0 +1,32 @@ +namespace Shiboken { +template <> +struct Converter<WId> +{ + static bool checkType(PyObject* pyObj) + { + return false; + } + + static bool isConvertible(PyObject* pyobj) + { + return PyCObject_Check(pyobj); + } + + static inline PyObject* toPython(void* cppobj) + { + // not supported + Q_ASSERT(true); + return 0; + } + + static PyObject* toPython(WId cppobj) + { + return PyCObject_FromVoidPtr(cppobj, 0); + } + + static WId toCpp(PyObject* pyobj) + { + return (WId) PyCObject_AsVoidPtr(pyobj); + } +}; +} |