aboutsummaryrefslogtreecommitdiffstats
path: root/cppgenerator.h
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-01-14 15:18:19 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-14 16:40:49 -0200
commit67f0c4988020833210537757fbd51ecb84825ce8 (patch)
tree805db73764d91ab3d6e9ea8d87b51207eeb343ca /cppgenerator.h
parentc40f61ff076928f07591070763069cc75918768e (diff)
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.
Diffstat (limited to 'cppgenerator.h')
-rw-r--r--cppgenerator.h1
1 files changed, 1 insertions, 0 deletions
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);