diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-05-20 10:52:46 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-05-20 11:10:45 -0300 |
commit | 980a1a15f6cc34af58c121cbdbad2e40c878617a (patch) | |
tree | d4eb02b27b6cd5b4dd31876156b585909044a7bd | |
parent | 7bbe60a475322395eb7522a9b2fbee6682a47818 (diff) |
Add a call to PySide::initQtMetaType for every type when the pyside extensions mode is on.
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r-- | cppgenerator.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 8bf84a67d..9677a9e76 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -134,8 +134,10 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl // headers s << "// default includes" << endl; s << "#include <shiboken.h>" << endl; - if (usePySideExtensions()) + if (usePySideExtensions()) { s << "#include <qsignal.h>" << endl; + s << "#include <pyside.h>" << endl; + } s << "#include <typeresolver.h>\n"; s << "#include <typeinfo>\n"; @@ -2822,6 +2824,12 @@ void CppGenerator::writeClassRegister(QTextStream& s, const AbstractMetaClass* m s << "TypeResolver<" << typeName << " >" << "(typeid(" << typeName << ").name());\n"; } + if (usePySideExtensions() && !metaClass->isNamespace()) { + // Qt metatypes are registered only on their first use, so we do this now. + const char* star = metaClass->typeEntry()->isObject() ? "*" : ""; + s << INDENT << "PySide::initQtMetaType<" << metaClass->qualifiedCppName() << star << " >();" << endl; + } + s << '}' << endl << endl; } |