WId conversions used on Windows OS.
Fixes bug #399. Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
83f8447c95
commit
5c9afb798e
2 changed files with 36 additions and 1 deletions
32
PySide/QtGui/glue/wid_conversions.h
Normal file
32
PySide/QtGui/glue/wid_conversions.h
Normal file
|
|
@ -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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,9 @@
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
-->
|
-->
|
||||||
<typesystem package="PySide.QtGui">
|
<typesystem package="PySide.QtGui">
|
||||||
<primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/>
|
<primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject" />
|
||||||
|
<primitive-type name="WId" target-lang-api-name="PyObject">
|
||||||
|
<conversion-rule file="glue/wid_conversions.h"/>
|
||||||
|
</primitive-type>
|
||||||
<enum-type name="QPixmap::HBitmapFormat" />
|
<enum-type name="QPixmap::HBitmapFormat" />
|
||||||
</typesystem>
|
</typesystem>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue