diff options
author | renatofilho <renato.filho@openbossa.org> | 2010-09-21 13:41:55 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:07:18 -0300 |
commit | f2bd66ead497ba2c17f2124ed7e1487251aca6d0 (patch) | |
tree | 9a0b2e0ff67b47118fbd6636fda1b1b79bc0e22a /generator/headergenerator.cpp | |
parent | 081600a9e5ac4da3eabe97169c9865af793f9c80 (diff) |
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>
Diffstat (limited to 'generator/headergenerator.cpp')
-rw-r--r-- | generator/headergenerator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/generator/headergenerator.cpp b/generator/headergenerator.cpp index 2e060f429..095febb70 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; |