From 2926ebb67df6ebe19cdf5b4961386f425a187f21 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Tue, 24 Aug 2010 16:43:05 -0300 Subject: Accepts inject conde on virtual functions before call c++ code. Reviewer: Luciano Wolf Hugo Parente Lima --- cppgenerator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 28d23f98c..62545dd0c 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -461,6 +461,15 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu s << INDENT << "if (py_override.isNull()) {" << endl; { Indentation indentation(INDENT); + + CodeSnipList snips; + if (func->hasInjectedCode()) { + snips = func->injectedCodeSnips(); + const AbstractMetaArgument* lastArg = func->arguments().isEmpty() ? 0 : func->arguments().last(); + writeCodeSnips(s, snips, CodeSnip::Beginning, TypeSystem::ShellCode, func, lastArg); + s << endl; + } + if (func->isAbstract()) { s << INDENT << "PyErr_SetString(PyExc_NotImplementedError, \"pure virtual method '"; s << func->ownerClass()->name() << '.' << func->name(); -- cgit v1.2.3