aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-29 10:07:04 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-30 13:09:36 +0200
commit1e4c98eb237d174ed01ed3df2a0f2467fb5f09e0 (patch)
treeaa64939c418e1cfc5c9d626838cd445eea104d23 /sources/shiboken2/ApiExtractor
parentfaf7c506a451cef1dc8229a3779eb62796c93e5f (diff)
shiboken2: Generate functions from invisible top level namespaces as global functions
Mainly add those in ShibokenGenerator::getGlobalFunctionGroups() with some adaptions. Task-number: PYSIDE-1075 Change-Id: I6dabac72c204904e76162542b5aa3ea1ac3b56ec Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp6
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index 29c2f153d..38fb5f152 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -803,6 +803,12 @@ bool AbstractMetaFunction::argumentRemoved(int key) const
return false;
}
+const AbstractMetaClass *AbstractMetaFunction::targetLangOwner() const
+{
+ return m_class && m_class->isInvisibleNamespace()
+ ? m_class->targetLangEnclosingClass() : m_class;
+}
+
bool AbstractMetaFunction::isDeprecated() const
{
const FunctionModificationList &modifications = this->modifications(declaringClass());
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h
index 693ecc4d4..91a6138d1 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h
@@ -907,6 +907,9 @@ public:
m_class = cls;
}
+ // Owner excluding invisible namespaces
+ const AbstractMetaClass *targetLangOwner() const;
+
// The first class in a hierarchy that declares the function
const AbstractMetaClass *declaringClass() const
{