aboutsummaryrefslogtreecommitdiffstats
path: root/headergenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'headergenerator.cpp')
-rw-r--r--headergenerator.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/headergenerator.cpp b/headergenerator.cpp
index 27086bc99..3310227f3 100644
--- a/headergenerator.cpp
+++ b/headergenerator.cpp
@@ -83,11 +83,15 @@ void HeaderGenerator::generateClass(QTextStream& s, const AbstractMetaClass* met
if (isCopyable(metaClass))
writeCopyCtor(s, metaClass);
- foreach (AbstractMetaFunction *func, filterFunctions(metaClass))
+ bool hasVirtualFunction = false;
+ foreach (AbstractMetaFunction *func, filterFunctions(metaClass)) {
+ if (func->isVirtual())
+ hasVirtualFunction = true;
writeFunction(s, func);
+ }
//destructor
- s << INDENT << (metaClass->hasVirtualDestructor() ? "virtual " : "") << "~" << wrapperName << "();" << endl;
+ s << INDENT << (metaClass->hasVirtualDestructor() || hasVirtualFunction ? "virtual " : "") << "~" << wrapperName << "();" << endl;
writeCodeSnips(s, metaClass->typeEntry()->codeSnips(), CodeSnip::Declaration, TypeSystem::NativeCode);