aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtGui/glue
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-10-14 16:32:29 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-10-15 13:50:18 -0300
commit5c9afb798ecc9ec29622464c9c96909a2e79f220 (patch)
tree4805322ddcdd69a014c73fc9f3a41c3d8a9564bd /PySide/QtGui/glue
parent83f8447c9546f53c134a10f02e81abdab88aed3a (diff)
WId conversions used on Windows OS.
Fixes bug #399. Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide/QtGui/glue')
-rw-r--r--PySide/QtGui/glue/wid_conversions.h32
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);
+ }
+};
+}