diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-07-01 16:06:29 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-07-02 16:51:12 +0200 |
commit | 9f0eb243cd264ae4f174ba38a1c958f42d338c80 (patch) | |
tree | 7955ddd930356f1c221a01a1b7a1d59f6a3120e4 /sources/shiboken6/ApiExtractor/abstractmetalang.h | |
parent | e2a3fa037b8133d857b34ddcecf1afe156095a4f (diff) |
shiboken6: Add support for operator bool
[ChangeLog][shiboken6] operator bool can now be used
for bool conversions (nb_bool) besides Qt-style isNull()
methods.
Add a command line option --use-operator-bool-as-nb_nonzero
similar to use-isnull-as-nb_nonzero, enabling the use of
operator bool for bool conversions.
Make it possible to override both settings in typesystem XML.
Task-number: PYSIDE-1334
Change-Id: I9c567e1b2cb97b22b41b3d9918046d793632160e
Reviewed-by: Christian Tismer <tismer@stackless.com>
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.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h index daa9eba1e..7b5ef4cc2 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h @@ -95,6 +95,9 @@ public: void addFunction(const AbstractMetaFunctionCPtr &function); bool hasFunction(const QString &str) const; AbstractMetaFunctionCPtr findFunction(const QString& functionName) const; + AbstractMetaFunctionCPtr findOperatorBool() const; + // Find a Qt-style isNull() method suitable for nb_bool + AbstractMetaFunctionCPtr findQtIsNullMethod() const; bool hasSignal(const AbstractMetaFunction *f) const; bool hasConstructors() const; |