aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
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/ApiExtractor
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/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.h1
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h
index d3ef2c629..2bbaabc91 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.h
+++ b/sources/shiboken2/ApiExtractor/typesystem.h
@@ -1209,6 +1209,7 @@ class ComplexTypeEntry : public TypeEntry
{
public:
enum TypeFlag {
+ DisableWrapper = 0x1,
Deprecated = 0x4
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 9ad9322b2..7b018cd4e 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 disableWrapperAttribute() { return QStringLiteral("disable-wrapper"); }
static inline QString exceptionHandlingAttribute() { return QStringLiteral("exception-handling"); }
static inline QString extensibleAttribute() { return QStringLiteral("extensible"); }
static inline QString fileNameAttribute() { return QStringLiteral("file-name"); }
@@ -1569,6 +1570,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 == disableWrapperAttribute()) {
+ if (convertBoolean(attributes->takeAt(i).value(), disableWrapperAttribute(), false))
+ ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::DisableWrapper);
} else if (name == deleteInMainThreadAttribute()) {
if (convertBoolean(attributes->takeAt(i).value(), deleteInMainThreadAttribute(), false))
ctype->setDeleteInMainThread(true);