aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside6/PySide6/QtCore/typesystem_core_common.xml2
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp32
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.h2
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h1
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractor.cpp1
5 files changed, 27 insertions, 11 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
index 7ac0e95ca..086de7e69 100644
--- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
+++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
@@ -520,8 +520,6 @@
<rejection class="QFile" function-name="setEncodingFunction"/>
<rejection class="QRegion" function-name="cleanUp"/>
<rejection class="QSettings" function-name="registerFormat"/>
- <rejection class="Qt" function-name="qt_getEnumMetaObject"/>
- <rejection class="Qt" function-name="qt_getEnumName"/>
<namespace-type name="Qt">
<extra-includes>
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 5fd6ce51e..995e1f316 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -1899,18 +1899,27 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio
return nullptr;
}
const QString &functionName = functionItem->name();
- QString className;
- if (currentClass) {
+ const QString className = currentClass != nullptr ?
+ currentClass->typeEntry()->qualifiedCppName() : QString{};
+
+ if (m_apiExtractorFlags.testFlag(ApiExtractorFlag::UsePySideExtensions)) {
+ // Skip enum helpers generated by Q_ENUM
+ if ((currentClass == nullptr || currentClass->isNamespace())
+ && (functionName == u"qt_getEnumMetaObject" || functionName == u"qt_getEnumName")) {
+ return nullptr;
+ }
+
// Clang: Skip qt_metacast(), qt_metacall(), expanded from Q_OBJECT
// and overridden metaObject(), QGADGET helpers
- if (functionName == u"qt_check_for_QGADGET_macro"
- || functionName.startsWith(u"qt_meta")) {
- return nullptr;
+ if (currentClass != nullptr) {
+ if (functionName == u"qt_check_for_QGADGET_macro"
+ || functionName.startsWith(u"qt_meta")) {
+ return nullptr;
+ }
+ if (functionName == u"metaObject" && className != u"QObject")
+ return nullptr;
}
- className = currentClass->typeEntry()->qualifiedCppName();
- if (functionName == u"metaObject" && className != u"QObject")
- return nullptr;
- }
+ } // PySide extensions
// Store original signature with unresolved typedefs for message/log purposes
const QString originalQualifiedSignatureWithReturn =
@@ -3389,6 +3398,11 @@ void AbstractMetaBuilder::setSkipDeprecated(bool value)
d->m_skipDeprecated = value;
}
+void AbstractMetaBuilder::setApiExtractorFlags(ApiExtractorFlags flags)
+{
+ d->m_apiExtractorFlags = flags;
+}
+
// PYSIDE-975: When receiving an absolute path name from the code model, try
// to resolve it against the include paths set on shiboken in order to recreate
// relative paths like #include <foo/bar.h>.
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder.h
index afbba9e86..ebdfce1c7 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.h
@@ -95,6 +95,8 @@ public:
void setSkipDeprecated(bool value);
+ void setApiExtractorFlags(ApiExtractorFlags flags);
+
enum TranslateTypeFlag {
DontResolveType = 0x1
};
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
index 18de68047..34f590945 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder_p.h
@@ -241,6 +241,7 @@ public:
QStringList m_headerPaths;
mutable QHash<QString, Include> m_resolveIncludeHash;
QList<TypeClassEntry> m_typeSystemTypeDefs; // look up metatype->class for type system typedefs
+ ApiExtractorFlags m_apiExtractorFlags;
bool m_skipDeprecated = false;
static bool m_useGlobalHeader;
static bool m_codeModelTestMode;
diff --git a/sources/shiboken6/ApiExtractor/apiextractor.cpp b/sources/shiboken6/ApiExtractor/apiextractor.cpp
index d0265c16a..4a06c1320 100644
--- a/sources/shiboken6/ApiExtractor/apiextractor.cpp
+++ b/sources/shiboken6/ApiExtractor/apiextractor.cpp
@@ -265,6 +265,7 @@ bool ApiExtractorPrivate::runHelper(ApiExtractorFlags flags)
m_builder->setGlobalHeaders(m_cppFileNames);
m_builder->setSkipDeprecated(m_skipDeprecated);
m_builder->setHeaderPaths(m_includePaths);
+ m_builder->setApiExtractorFlags(flags);
QByteArrayList arguments;
const auto clangOptionsSize = m_clangOptions.size();