diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-06 16:46:33 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-09 12:19:04 +0000 |
commit | 0a1860ee76cb2600299d51439592c75ab20d0d6f (patch) | |
tree | 61007e33d394e34aca129a4d56be45f55919ab36 | |
parent | c9cefb4ab7f93a64fc1f34a71745f697e0a46e44 (diff) |
AbstractMetaFunction: Show whether a function is user-declared
Extends 40483a4249306b62029987d03e7de57d456954b2.
Change-Id: Ia2f78e5804de973ae4e21e38fcbe3a55bc92a032
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetafunction.cpp | 7 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetafunction.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp index 5d390ffa9..f295caa89 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp @@ -254,6 +254,11 @@ bool AbstractMetaFunction::isUserAdded() const return !m_addedFunction.isNull() && !m_addedFunction->isDeclaration(); } +bool AbstractMetaFunction::isUserDeclared() const +{ + return !m_addedFunction.isNull() && m_addedFunction->isDeclaration(); +} + int AbstractMetaFunction::actualMinimumArgumentCount() const { AbstractMetaArgumentList arguments = this->arguments(); @@ -862,6 +867,8 @@ void AbstractMetaFunction::formatDebugVerbose(QDebug &d) const d << " [reverse]"; if (isUserAdded()) d << " [userAdded]"; + if (isUserDeclared()) + d << " [userDeclared]"; if (m_explicit) d << " [explicit]"; if (attributes().testFlag(AbstractMetaAttributes::Deprecated)) diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.h b/sources/shiboken6/ApiExtractor/abstractmetafunction.h index 21dc19db2..21da91c56 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetafunction.h +++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.h @@ -220,6 +220,9 @@ public: /// Returns true if the AbstractMetaFunction was added by the user via the type system description. bool isUserAdded() const; + /// Returns true if the AbstractMetaFunction was declared by the user via + /// the type system description. + bool isUserDeclared() const; QString toString() const { return m_name; } |