aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetafunction.cpp16
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetafunction.h2
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp9
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.cpp3
4 files changed, 22 insertions, 8 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
index 87a5d3edc..f5b9b168f 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
@@ -400,6 +400,22 @@ bool AbstractMetaFunction::usesRValueReferences() const
return false;
}
+bool AbstractMetaFunction::generateBinding() const
+{
+ switch (d->m_functionType) {
+ case ConversionOperator:
+ case AssignmentOperatorFunction:
+ case MoveAssignmentOperatorFunction:
+ return false;
+ default:
+ break;
+ }
+ if (isPrivate() && d->m_functionType != EmptyFunction)
+ return false;
+ return d->m_name != u"qt_metacall" && !usesRValueReferences()
+ && !isModifiedRemoved();
+}
+
QStringList AbstractMetaFunction::introspectionCompatibleSignatures(const QStringList &resolvedArguments) const
{
AbstractMetaArgumentList arguments = this->arguments();
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.h b/sources/shiboken6/ApiExtractor/abstractmetafunction.h
index b677cf0ea..46bb708fa 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetafunction.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.h
@@ -273,6 +273,8 @@ public:
void setFunctionType(FunctionType type);
bool usesRValueReferences() const;
+ bool generateBinding() const;
+
QStringList introspectionCompatibleSignatures(const QStringList &resolvedArguments = QStringList()) const;
QString signature() const;
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index dbe8ee9b2..a89c7f88b 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -532,13 +532,8 @@ void CppGenerator::generateClass(TextStream &s, const GeneratorContext &classCon
QSet<QString> seenSignatures;
bool staticEncountered = false;
for (const auto &func : it.value()) {
- if (!func->isAssignmentOperator()
- && !func->usesRValueReferences()
- && !func->isConversionOperator()
- && !func->isModifiedRemoved()
- && (!func->isPrivate() || func->functionType() == AbstractMetaFunction::EmptyFunction)
- && func->ownerClass() == func->implementingClass()
- && (func->name() != QLatin1String("qt_metacall"))) {
+ if (func->ownerClass() == func->implementingClass()
+ && func->generateBinding()) {
// PYSIDE-331: Inheritance works correctly when there are disjoint functions.
// But when a function is both in a class and inherited in a subclass,
// then we need to search through all subclasses and collect the new signatures.
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
index 89379a310..920c668c1 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
@@ -2292,7 +2292,8 @@ AbstractMetaFunctionCList
for (; basis; basis = basis->baseClass()) {
const auto inFunctions = basis->findFunctions(func->name());
for (const auto &inFunc : inFunctions) {
- if (!seen->contains(inFunc->minimalSignature())) {
+ if (inFunc->generateBinding()
+ && !seen->contains(inFunc->minimalSignature())) {
seen->insert(inFunc->minimalSignature());
AbstractMetaFunction *newFunc = inFunc->copy();
newFunc->setImplementingClass(func->implementingClass());