aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-01-07 14:59:49 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-07 15:08:51 -0200
commite439aca9d2a27546d22db85bcebacb3d0615bd68 (patch)
treeecea5cbaaa9090fcb18116d0b4515e3d195da035 /libpyside
parentaade838add186bf92a2d2d14a77f5469bd23f4c2 (diff)
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>
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/typeresolver.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpyside/typeresolver.h b/libpyside/typeresolver.h
index 84191f578..bb59f83e8 100644
--- a/libpyside/typeresolver.h
+++ b/libpyside/typeresolver.h
@@ -62,6 +62,12 @@ inline void objectDeleter(void* 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
{
public:
@@ -80,7 +86,7 @@ public:
template<typename T>
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);