When object-types are passed through signals the void pointers are pointers to pointers of the object, not just
pointers to the object like is used to happen with value-types. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
aade838add
commit
e439aca9d2
1 changed files with 7 additions and 1 deletions
|
|
@ -62,6 +62,12 @@ inline void objectDeleter(void* data)
|
||||||
delete reinterpret_cast<T*>(data);
|
delete reinterpret_cast<T*>(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline PyObject* objectTypeToPython(void* cptr)
|
||||||
|
{
|
||||||
|
return Shiboken::Converter<T>::toPython(*(T*)cptr);
|
||||||
|
}
|
||||||
|
|
||||||
class PYSIDE_API TypeResolver
|
class PYSIDE_API TypeResolver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -80,7 +86,7 @@ public:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static TypeResolver* createObjectTypeResolver(const char* typeName)
|
static TypeResolver* createObjectTypeResolver(const char* typeName)
|
||||||
{
|
{
|
||||||
return new TypeResolver(typeName, &Shiboken::Converter<T>::toPython, &pythonToObjectType<T>);
|
return new TypeResolver(typeName, &objectTypeToPython<T>, &pythonToObjectType<T>);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TypeResolver* get(const char* typeName);
|
static TypeResolver* get(const char* typeName);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue