aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside6/PySide6/QtCore/typesystem_core_common.xml3
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp46
-rw-r--r--sources/shiboken6/ApiExtractor/messages.cpp10
-rw-r--r--sources/shiboken6/ApiExtractor/messages.h3
4 files changed, 52 insertions, 10 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
index 0d905b9c0..e9bbc6249 100644
--- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
+++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
@@ -1772,9 +1772,6 @@
<reference-count action="set"/>
</modify-argument>
</modify-function>
- <!-- FIXME PYSIDE 7: Remove this (QT6_DECL_NEW_OVERLOAD_TAIL) -->
- <modify-function signature="^moveToThread\(.*\)" remove="all"/>
- <declare-function signature="moveToThread(QThread*)" return-type="bool"/>
<modify-function signature="deleteLater()">
<modify-argument index="this">
<define-ownership owner="c++"/>
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index f07fb96c6..0b11f2fb4 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -1975,6 +1975,29 @@ void AbstractMetaBuilderPrivate::rejectFunction(const FunctionModelItem &functio
m_rejectedFunctions.insert({reason, signatureWithType, sortKey, rejectReason});
}
+// Check for special Qt argument types which should be ignored.
+enum class QtSpecialArgument
+{
+ None,
+ PrivateSignal,
+ Disambiguated // by QT6_DECL_NEW_OVERLOAD_TAIL
+};
+
+static QtSpecialArgument qtSpecialArgument(CodeModel::FunctionType functionType,
+ const ArgumentList &arguments)
+{
+ if (arguments.isEmpty())
+ return QtSpecialArgument::None;
+ const QStringList &lastArgumentType = arguments.constLast()->type().qualifiedName();
+ if (functionType == CodeModel::Signal && lastArgumentType.constLast() == "QPrivateSignal"_L1)
+ return QtSpecialArgument::PrivateSignal;
+ if (lastArgumentType.size() == 2 && lastArgumentType.constFirst() == "Qt"_L1
+ && lastArgumentType.constLast() == "Disambiguated_t"_L1) {
+ return QtSpecialArgument::Disambiguated;
+ }
+ return QtSpecialArgument::None;
+}
+
AbstractMetaFunctionPtr
AbstractMetaBuilderPrivate::traverseFunction(const FunctionModelItem &functionItem,
const AbstractMetaClassPtr &currentClass)
@@ -2107,13 +2130,22 @@ AbstractMetaFunctionPtr
}
ArgumentList arguments = functionItem->arguments();
- // Add private signals for documentation purposes
- if (!arguments.isEmpty()
- && m_apiExtractorFlags.testFlag(ApiExtractorFlag::UsePySideExtensions)
- && functionItem->functionType() == CodeModel::Signal
- && arguments.constLast()->type().qualifiedName().constLast() == u"QPrivateSignal") {
- flags.setFlag(AbstractMetaFunction::Flag::PrivateSignal);
- arguments.removeLast();
+ if (m_apiExtractorFlags.testFlag(ApiExtractorFlag::UsePySideExtensions)) {
+ switch (qtSpecialArgument(functionItem->functionType(), arguments)) {
+ case QtSpecialArgument::None:
+ break;
+ case QtSpecialArgument::PrivateSignal:
+ flags.setFlag(AbstractMetaFunction::Flag::PrivateSignal);
+ arguments.removeLast(); // Add private signals for documentation purposes
+ break;
+ case QtSpecialArgument::Disambiguated: {
+ const QString signature = qualifiedFunctionSignatureWithType(functionItem, className);
+ qCWarning(lcShiboken, "%s",
+ qPrintable(msgStrippingQtDisambiguatedArgument(functionItem, signature)));
+ arguments.removeLast(); // Strip QT6_DECL_NEW_OVERLOAD_TAIL
+ }
+ break;
+ }
}
if (arguments.size() == 1) {
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp
index 543deff4b..6ed0cceae 100644
--- a/sources/shiboken6/ApiExtractor/messages.cpp
+++ b/sources/shiboken6/ApiExtractor/messages.cpp
@@ -408,6 +408,16 @@ QString msgStrippingArgument(const FunctionModelItem &f, int i,
return result;
}
+QString msgStrippingQtDisambiguatedArgument(const FunctionModelItem &f,
+ const QString &originalSignature)
+{
+ QString result;
+ QTextStream str(&result);
+ str << f->sourceLocation() << "Stripping last argument of "
+ << originalSignature << " (QT6_DECL_NEW_OVERLOAD_TAIL).";
+ return result;
+}
+
QString msgEnumNotDefined(const EnumTypeEntryCPtr &t)
{
QString result;
diff --git a/sources/shiboken6/ApiExtractor/messages.h b/sources/shiboken6/ApiExtractor/messages.h
index 7328c78b7..5412a8b6c 100644
--- a/sources/shiboken6/ApiExtractor/messages.h
+++ b/sources/shiboken6/ApiExtractor/messages.h
@@ -102,6 +102,9 @@ QString msgStrippingArgument(const FunctionModelItem &f, int i,
const ArgumentModelItem &arg,
const QString &reason);
+QString msgStrippingQtDisambiguatedArgument(const FunctionModelItem &f,
+ const QString &originalSignature);
+
QString msgEnumNotDefined(const EnumTypeEntryCPtr &t);
QString msgUnknownBase(const AbstractMetaClassCPtr &metaClass,