aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-04 09:27:38 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-04 19:40:45 +0000
commit170756fa1e5de0ce7ba33521f1eb168d70ad276d (patch)
treebf4d438ff50154f1f942e8b2c2100ce7538e7855 /sources/shiboken2/generator/shiboken2
parentdda4d53d8b9bdc2a18e8f3f295bd9c887c8742e0 (diff)
shiboken: Do not generate wrappers for final classes
Check the attributes and add test. Change-Id: I6c3d76ed32b5d20b6940849dd4895f98abd62fca Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 530d9b143..5a6d5fc17 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -241,6 +241,8 @@ QString ShibokenGenerator::translateTypeForWrapperMethod(const AbstractMetaType*
bool ShibokenGenerator::shouldGenerateCppWrapper(const AbstractMetaClass* metaClass) const
{
+ if (metaClass->isNamespace() || (metaClass->attributes() & AbstractMetaAttributes::FinalCppClass))
+ return false;
bool result = metaClass->isPolymorphic() || metaClass->hasVirtualDestructor();
if (avoidProtectedHack()) {
result = result || metaClass->hasProtectedFields() || metaClass->hasProtectedDestructor();
@@ -261,7 +263,7 @@ bool ShibokenGenerator::shouldGenerateCppWrapper(const AbstractMetaClass* metaCl
} else {
result = result && !metaClass->hasPrivateDestructor();
}
- return result && !metaClass->isNamespace();
+ return result;
}
void ShibokenGenerator::lookForEnumsInClassesNotToBeGenerated(AbstractMetaEnumList& enumList, const AbstractMetaClass* metaClass)