diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-03 10:27:06 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-03 11:13:23 +0100 |
commit | fcbbab0a6b5949b5c3726214ed87898b5fbcebcc (patch) | |
tree | fa32abe22f62adb4397aa439c99f735a82dadf9e | |
parent | 50f382579d1323817165d85bf88a394328a4e9a0 (diff) |
shiboken: Add XML attribute to turn off method caching
Task-number: PYSIDE-803
Change-Id: I0ba80cea5804e1b83cc55ee32163ca9d021ccd26
Reviewed-by: Christian Tismer <tismer@stackless.com>
4 files changed, 12 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml index 223eff773..12c1ac33d 100644 --- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml +++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml @@ -64,7 +64,7 @@ <object-type name="QQuickImageResponse" since="5.6"/> <object-type name="QQuickTransform"/> - <object-type name="QQuickItem" delete-in-main-thread="true"> + <object-type name="QQuickItem" delete-in-main-thread="true" no-override-caching="true"> <value-type name="UpdatePaintNodeData"/> <enum-type name="Flag" flags="Flags"/> <enum-type name="ItemChange"/> diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h index 4d0a23ca1..8d8d60f3f 100644 --- a/sources/shiboken2/ApiExtractor/typesystem.h +++ b/sources/shiboken2/ApiExtractor/typesystem.h @@ -1219,7 +1219,8 @@ class ComplexTypeEntry : public TypeEntry { public: enum TypeFlag { - Deprecated = 0x4 + Deprecated = 0x4, + NoOverrideCaching = 0x8 }; Q_DECLARE_FLAGS(TypeFlags, TypeFlag) diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp index 0bb56f0fe..5252ac00a 100644 --- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp @@ -60,6 +60,7 @@ static inline QString untilAttribute() { return QStringLiteral("until"); } static inline QString defaultSuperclassAttribute() { return QStringLiteral("default-superclass"); } static inline QString deleteInMainThreadAttribute() { return QStringLiteral("delete-in-main-thread"); } static inline QString deprecatedAttribute() { return QStringLiteral("deprecated"); } +static inline QString noOverrideCachingAttribute() { return QStringLiteral("no-override-caching"); } static inline QString exceptionHandlingAttribute() { return QStringLiteral("exception-handling"); } static inline QString extensibleAttribute() { return QStringLiteral("extensible"); } static inline QString flagsAttribute() { return QStringLiteral("flags"); } @@ -1476,6 +1477,9 @@ void TypeSystemParser::applyComplexTypeAttributes(const QXmlStreamReader &reader } else if (name == deprecatedAttribute()) { if (convertBoolean(attributes->takeAt(i).value(), deprecatedAttribute(), false)) ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::Deprecated); + } else if (name == noOverrideCachingAttribute()) { + if (convertBoolean(attributes->takeAt(i).value(), noOverrideCachingAttribute(), false)) + ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::NoOverrideCaching); } else if (name == deleteInMainThreadAttribute()) { if (convertBoolean(attributes->takeAt(i).value(), deleteInMainThreadAttribute(), false)) ctype->setDeleteInMainThread(true); diff --git a/sources/shiboken2/doc/typesystem_specifying_types.rst b/sources/shiboken2/doc/typesystem_specifying_types.rst index bca1e0774..3ab6adbd6 100644 --- a/sources/shiboken2/doc/typesystem_specifying_types.rst +++ b/sources/shiboken2/doc/typesystem_specifying_types.rst @@ -300,6 +300,7 @@ object-type allow-thread="..." exception-handling="..." hash-function="..." + no-override-caching="yes | no" stream="yes | no" revision="..." /> </typesystem> @@ -323,6 +324,10 @@ object-type specify the default handling for the corresponding function modification (see :ref:`modify-function`). + The *optional* attribute **no-override-caching** can be used to turn off the + caching of methods overridden in Python, which can trigger obscure bugs when + setting attributes in Python 2. + interface-type ^^^^^^^^^^^^^^ |