From 67f0c4988020833210537757fbd51ecb84825ce8 Mon Sep 17 00:00:00 2001 From: Hugo Lima Date: Thu, 14 Jan 2010 15:18:19 -0200 Subject: Implemented type discovery feature. The problem: - There are two class, A and B, B inherits from A. - You are inside a virtual method reimplemented in python with just one parameter of type A*. - But the object referenced by a variable of type A* is an instance of B and it was created by C++, not Python! - Shiboken needs to create a PyObject of type B, not A! This does not makes sense for C++, but does for Python, because python variables does not store type information, just values. To achieve this we use RTTI to get the real type name of a variable, then we create the PyObject using the TypeResolver infrastructure initially developed to help with signal slot problems. In other words, the TypeResolver class has been moved from libpyside to libshiboken. --- cppgenerator.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cppgenerator.h') diff --git a/cppgenerator.h b/cppgenerator.h index 132a075cd..15e0a05fc 100644 --- a/cppgenerator.h +++ b/cppgenerator.h @@ -65,6 +65,7 @@ private: void writeTypeCheck(QTextStream& s, const OverloadData* overloadData, QString argumentName); void writeTypeConverterImpl(QTextStream& s, const TypeEntry* type); + void writeTypeNameFunction(QTextStream& s, const AbstractMetaClass* metaClass); void writeSbkCopyCppObjectFunction(QTextStream& s, const AbstractMetaClass* metaClass); -- cgit v1.2.3