summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-14 15:16:22 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-17 19:56:46 -0300
commit226144304f75e749424a9f7ae2dc9a566c3cfc4e (patch)
treeb10f0f49527ba4cc4c972221c4f6a9d0764655b1
parentfc7800974e6a9830ebb4fc583763b038a63ae231 (diff)
downloadshiboken-226144304f75e749424a9f7ae2dc9a566c3cfc4e.tar.gz
shiboken-226144304f75e749424a9f7ae2dc9a566c3cfc4e.tar.xz
shiboken-226144304f75e749424a9f7ae2dc9a566c3cfc4e.zip
generate code necessary to register signal and slot.
eviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--cppgenerator.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index d02af3db..3577d46e 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -134,6 +134,9 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl
// headers
s << "// default includes" << endl;
s << "#include <shiboken.h>" << endl;
+ if (usePySideExtensions())
+ s << "#include <qsignal.h>" << endl;
+
s << "#include <typeresolver.h>\n";
s << "#include <typeinfo>\n";
if (usePySideExtensions()) {
@@ -596,7 +599,7 @@ void CppGenerator::writeMetaObjectMethod(QTextStream& s, const AbstractMetaClass
<< INDENT << "if (!typeData) {" << endl;
{
Indentation indentation2(INDENT);
- s << INDENT << "m_metaObject = PySide::DynamicQMetaObject::createBasedOn(pySelf->ob_type, &"
+ s << INDENT << "m_metaObject = PySide::DynamicQMetaObject::createBasedOn(pySelf, pySelf->ob_type, &"
<< metaClass->qualifiedCppName() << "::staticMetaObject);" << endl
<< INDENT << "Shiboken::setTypeUserData(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pySelf), m_metaObject, PySide::deleteDynamicQMetaObject);" << endl;
}
@@ -739,6 +742,13 @@ void CppGenerator::writeConstructorWrapper(QTextStream& s, const AbstractMetaFun
s << '}' << endl;
}
+ s << endl;
+
+ if (metaClass->isQObject()) {
+ s << INDENT << "cptr->metaObject();" << endl;
+ if (usePySideExtensions())
+ s << INDENT << "PySide::signal_update_source(self);" << endl;
+ }
s << endl << INDENT << "return 1;" << endl;
if (overloadData.maxArgs() > 0)
writeErrorSection(s, overloadData);