aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-14 09:29:55 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-27 11:09:08 +0000
commit1d044f467070a040713c9566a8a8de3a56c571e7 (patch)
tree0762dbf77a7192e3d8e3223c39e5893f720bd023 /sources/shiboken2/generator
parent1d35b9d4070d57a801ba1ee9a99bde4d6f0de428 (diff)
shiboken2: Add a disable-wrapper attribute for complex types
Make it possible to disable the generation of a C++ wrapper in case that poses some problem. Task-number: PYSIDE-1202 Change-Id: Id0d557e4d4a57cf537be8fb398161aea3a16e174 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/shiboken/shibokengenerator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/shiboken/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken/shibokengenerator.cpp
index c097f4355..5382b3a9f 100644
--- a/sources/shiboken2/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken/shibokengenerator.cpp
@@ -300,8 +300,11 @@ QString ShibokenGenerator::translateTypeForWrapperMethod(const AbstractMetaType
bool ShibokenGenerator::shouldGenerateCppWrapper(const AbstractMetaClass *metaClass) const
{
- if (metaClass->isNamespace() || (metaClass->attributes() & AbstractMetaAttributes::FinalCppClass))
+ if (metaClass->isNamespace()
+ || metaClass->attributes().testFlag(AbstractMetaAttributes::FinalCppClass)
+ || metaClass->typeEntry()->typeFlags().testFlag(ComplexTypeEntry::DisableWrapper)) {
return false;
+ }
bool result = metaClass->isPolymorphic() || metaClass->hasVirtualDestructor();
if (avoidProtectedHack()) {
result = result || metaClass->hasProtectedFields() || metaClass->hasProtectedDestructor();