diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-10 17:23:47 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:08:58 -0300 |
commit | c3e3500c309be004434293895775e5579656d72c (patch) | |
tree | 37f2ec513b06250874224830900195afdd716819 | |
parent | 71b34999be9d1f7db63785a13b3ed00b87f3ddd7 (diff) |
Fix the metaObject method written by the generator after the changed in libshiboken.
-rw-r--r-- | generator/cppgenerator.cpp | 8 | ||||
-rw-r--r-- | libshiboken/conversions.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index e69ff3c71..68f90ce06 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -778,14 +778,14 @@ void CppGenerator::writeMetaObjectMethod(QTextStream& s, const AbstractMetaClass s << INDENT << "if (!m_metaObject) {\n"; { Indentation indentation(INDENT); - s << INDENT << "PyObject *pySelf = BindingManager::instance().retrieveWrapper(this);\n" - << INDENT << "void *typeData = Shiboken::getTypeUserData(reinterpret_cast<SbkObject*>(pySelf));" << endl + s << INDENT << "SbkObject* pySelf = BindingManager::instance().retrieveWrapper(this);\n" + << INDENT << "void* typeData = Shiboken::getTypeUserData(pySelf);" << endl << INDENT << "if (!typeData) {" << endl; { Indentation indentation2(INDENT); - s << INDENT << "m_metaObject = PySide::DynamicQMetaObject::createBasedOn(pySelf, pySelf->ob_type, &" + s << INDENT << "m_metaObject = PySide::DynamicQMetaObject::createBasedOn((PyObject*)pySelf, pySelf->ob_type, &" << metaClass->qualifiedCppName() << "::staticMetaObject);" << endl - << INDENT << "Shiboken::setTypeUserData(reinterpret_cast<SbkObject*>(pySelf), m_metaObject, PySide::deleteDynamicQMetaObject);" << endl; + << INDENT << "Shiboken::setTypeUserData(pySelf, m_metaObject, PySide::deleteDynamicQMetaObject);" << endl; } s << INDENT << "} else {" << endl; { diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h index d8e28371f..4d55ef0fe 100644 --- a/libshiboken/conversions.h +++ b/libshiboken/conversions.h @@ -275,7 +275,9 @@ struct ObjectTypeConverter return 0; SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(pyobj->ob_type); if (shiboType->mi_specialcast) - return (T*) shiboType->mi_specialcast(Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()), reinterpret_cast<SbkObjectType*>(SbkType<T>())); + return (T*) shiboType->mi_specialcast( + Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()), + reinterpret_cast<SbkObjectType*>(SbkType<T>())); return (T*) Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()); } }; |