summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-09-21 13:41:55 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-09-21 14:51:04 -0300
commit06f1f83e0e8f39cde919bdb8a3441823bc5a5bb2 (patch)
tree56c621ae24e15a676f32f93cbd5f2a60ffb1ebe5
parent55a8b424067fcf3c6a2cc3f6f9b9708b17553a6f (diff)
downloadshiboken-06f1f83e0e8f39cde919bdb8a3441823bc5a5bb2.tar.gz
shiboken-06f1f83e0e8f39cde919bdb8a3441823bc5a5bb2.tar.xz
shiboken-06f1f83e0e8f39cde919bdb8a3441823bc5a5bb2.zip
Fixed function use to create wrapper based on QObject.
Fixes bug #360. Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--generator/headergenerator.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/generator/headergenerator.cpp b/generator/headergenerator.cpp
index 2e060f42..095febb7 100644
--- a/generator/headergenerator.cpp
+++ b/generator/headergenerator.cpp
@@ -428,8 +428,12 @@ void HeaderGenerator::finishGeneration()
s << "inline PyObject* createWrapper<" << metaClass->qualifiedCppName() << " >(const ";
s << metaClass->qualifiedCppName() << "* cppobj, bool hasOwnership, bool isExactType)" << endl;
s << '{' << endl;
+ s << INDENT << "const char* typeName = 0;" << endl;
+ s << INDENT << metaClass->qualifiedCppName() << "* value = const_cast<" << metaClass->qualifiedCppName() << "* >(cppobj);" << endl;
+ s << INDENT << "if (!isExactType)" << endl;
+ s << INDENT << INDENT << "typeName = typeid(*value).name();" << endl;
s << INDENT << "PyObject* pyObj = Shiboken::SbkBaseWrapper_New(reinterpret_cast<SbkBaseWrapperType*>(SbkType<" << metaClass->qualifiedCppName() << " >()),"
- << "const_cast<" << metaClass->qualifiedCppName() << "*>(cppobj), hasOwnership, isExactType);" << endl;
+ << "value, hasOwnership, isExactType, typeName);" << endl;
s << INDENT << "PySide::signalUpdateSource(pyObj);" << endl;
s << INDENT << "return pyObj;" << endl;
s << '}' << endl;