aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-01 20:30:31 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-02 11:29:41 +0100
commit63a27d827a990ef8ff36c30602ff80a6130edb17 (patch)
tree6af4b379b022c7a6cece944c7912451c0b2da717 /sources/shiboken6/ApiExtractor/abstractmetalang.h
parent4d7c6e0ac10dc49abb7e7d4ad07503449906f459 (diff)
shiboken6: Refactor C++ wrapper generation handling
The "disable-wrapper" attribute introduced by 1d044f467070a040713c9566a8a8de3a56c571e7 was not working in case the protected hack was disabled due to inconsistent, duplicated checking of conditions. Move the wrapper check into AbstractMetaClass and let it return a flags type that indicates whether the wrapper is needed for protected functions or virtual methods. Task-number: PYSIDE-1202 Change-Id: I56c0ed58a70d36e53fdd8a9c76f5eff0a832f469 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h
index 3626ba469..e1e90863f 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h
@@ -55,6 +55,13 @@ class AbstractMetaClass : public AbstractMetaAttributes, public EnclosingClassMi
public:
Q_DISABLE_COPY_MOVE(AbstractMetaClass)
+ enum CppWrapperFlag {
+ NoCppWrapper = 0x0,
+ CppProtectedHackWrapper = 0x1,// Make protected functions accessible
+ CppVirtualMethodWrapper = 0x2 // Need C++ wrapper for calling Python overrides
+ };
+ Q_DECLARE_FLAGS(CppWrapper, CppWrapperFlag)
+
AbstractMetaClass();
~AbstractMetaClass();
@@ -92,6 +99,8 @@ public:
bool generateExceptionHandling() const;
+ CppWrapper cppWrapper() const;
+
AbstractMetaFunctionCList queryFunctionsByName(const QString &name) const;
static bool queryFunction(const AbstractMetaFunction *f, FunctionQueryOptions query);
static AbstractMetaFunctionCList queryFunctionList(const AbstractMetaFunctionCList &list,
@@ -337,4 +346,6 @@ void AbstractMetaClass::invisibleNamespaceRecursion(Function f) const
}
}
+Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaClass::CppWrapper);
+
#endif // ABSTRACTMETALANG_H