aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-04-16 13:45:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-04-17 10:52:51 +0200
commit1bca8bf41719a051df7304101b48ca1db6112088 (patch)
treec5c2278f721110daf5dbfc705288b1e9f8a4490c /sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
parentd2be09eef06241cd4c9eb7a0ca1a993dc2355f02 (diff)
parentc121c29952f3070e110dc9a9c86bf5fd41c14d92 (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.14.2"
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/shibokengenerator.cpp')
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index fbd3c314b..2cdb8870c 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -2202,9 +2202,7 @@ bool ShibokenGenerator::injectedCodeUsesArgument(const AbstractMetaFunction *fun
bool ShibokenGenerator::useOverrideCaching(const AbstractMetaClass *metaClass)
{
- return metaClass->isPolymorphic()
- && !metaClass->typeEntry()->typeFlags().testFlag(ComplexTypeEntry::NoOverrideCaching);
-
+ return metaClass->isPolymorphic();
}
ShibokenGenerator::AttroCheck ShibokenGenerator::checkAttroFunctionNeeds(const AbstractMetaClass *metaClass) const
@@ -2219,6 +2217,13 @@ ShibokenGenerator::AttroCheck ShibokenGenerator::checkAttroFunctionNeeds(const A
result |= AttroCheckFlag::SetattroQObject;
if (useOverrideCaching(metaClass))
result |= AttroCheckFlag::SetattroMethodOverride;
+ // PYSIDE-1255: If setattro is generated for a class inheriting
+ // QObject, the property code needs to be generated, too.
+ if ((result & AttroCheckFlag::SetattroMask) != 0
+ && !result.testFlag(AttroCheckFlag::SetattroQObject)
+ && metaClass->isQObject()) {
+ result |= AttroCheckFlag::SetattroQObject;
+ }
}
return result;
}