diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-05-08 09:47:23 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-05-11 10:49:40 +0000 |
commit | 293c5d41a428cf69e18c49854dc9ced47a0c603d (patch) | |
tree | b809b64bdf36d8d563583ac7067d5c30da9530ef | |
parent | 667fdda3147b1556c13d6e9eab7155facbf4c0f6 (diff) |
shiboken6: Correctly register smartpointer signatures
Drop the space before the closing bracket (no longer required in C++)
which is causing signatures mismatches when using it signals.
Task-number: PYSIDE-2316
Change-Id: Ia460a0868454cc7a2a41e82ef921e50a40fcc45d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 17ef62122f31264942b3799fd502bcbac39fcc1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
4 files changed, 11 insertions, 11 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp index 21455c7ff..5ee6225ff 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp @@ -619,7 +619,7 @@ QString AbstractMetaTypeData::formatSignature(bool minimal) const result += u','; result += m_instantiations.at(i).minimalSignature(); } - result += u" >"_s; + result += u'>'; } if (!minimal && (!m_indirections.isEmpty() || m_referenceType != NoReference)) diff --git a/sources/shiboken6/ApiExtractor/tests/testabstractmetatype.cpp b/sources/shiboken6/ApiExtractor/tests/testabstractmetatype.cpp index 644ae8aa1..4a2821db8 100644 --- a/sources/shiboken6/ApiExtractor/tests/testabstractmetatype.cpp +++ b/sources/shiboken6/ApiExtractor/tests/testabstractmetatype.cpp @@ -193,7 +193,7 @@ void TestAbstractMetaType::testTypedefWithTemplates() QCOMPARE(args.size(), 1); const AbstractMetaArgument &arg = args.constFirst(); AbstractMetaType metaType = arg.type(); - QCOMPARE(metaType.cppSignature(), u"A<B >"); + QCOMPARE(metaType.cppSignature(), u"A<B>"); } diff --git a/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp b/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp index 1c653df51..eba2ecea9 100644 --- a/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp +++ b/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp @@ -64,7 +64,7 @@ namespace Internet { QVERIFY(func); AbstractMetaType funcType = func->type(); QVERIFY(!funcType.isVoid()); - QCOMPARE(funcType.cppSignature(), u"QList<Internet::Url >"); + QCOMPARE(funcType.cppSignature(), u"QList<Internet::Url>"); } void TestTemplates::testTemplateOnContainers() @@ -137,7 +137,7 @@ void func(List<int> arg) {} const auto func = globalFuncs.constFirst(); QCOMPARE(func->minimalSignature(), u"func(List<int>)"); QCOMPARE(func->arguments().constFirst().type().cppSignature(), - u"List<int >"); + u"List<int>"); } void TestTemplates::testTemplatePointerAsArgument() @@ -162,7 +162,7 @@ void func(List<int>* arg) {} const auto func = globalFuncs.constFirst(); QCOMPARE(func->minimalSignature(), u"func(List<int>*)"); QCOMPARE(func->arguments().constFirst().type().cppSignature(), - u"List<int > *"); + u"List<int> *"); } void TestTemplates::testTemplateReferenceAsArgument() @@ -187,7 +187,7 @@ void func(List<int>& arg) {} const auto func = globalFuncs.constFirst(); QCOMPARE(func->minimalSignature(), u"func(List<int>&)"); QCOMPARE(func->arguments().constFirst().type().cppSignature(), - u"List<int > &"); + u"List<int> &"); } void TestTemplates::testTemplateParameterFixup() @@ -214,11 +214,11 @@ struct List { QCOMPARE(templates.size(), 1); AbstractMetaClassCPtr list = templates.constFirst(); - // Verify that the parameter of "void append(List l)" gets fixed to "List<T >" + // Verify that the parameter of "void append(List l)" gets fixed to "List<T>" const auto append = list->findFunction(QStringLiteral("append")); QVERIFY(append); QCOMPARE(append->arguments().size(), 1); - QCOMPARE(append->arguments().at(0).type().cppSignature(), u"List<T >"); + QCOMPARE(append->arguments().at(0).type().cppSignature(), u"List<T>"); // Verify that the parameter of "void erase(Iterator)" is not modified const auto erase = list->findFunction(QStringLiteral("erase")); QVERIFY(erase); @@ -424,13 +424,13 @@ typedef Vector<int> IntVector; const auto method = vector->findFunction(u"method"); QVERIFY(method); - QCOMPARE(method->signature(), u"method(const Vector<int > & vector)"); + QCOMPARE(method->signature(), u"method(const Vector<int> & vector)"); const auto otherMethod = vector->findFunction(u"otherMethod"); QVERIFY(otherMethod); QCOMPARE(otherMethod->signature(), u"otherMethod()"); QVERIFY(!otherMethod->type().isVoid()); - QCOMPARE(otherMethod->type().cppSignature(), u"Vector<int >"); + QCOMPARE(otherMethod->type().cppSignature(), u"Vector<int>"); } void TestTemplates::testNonTypeTemplates() diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 670739c73..b0e53fcaf 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -2109,7 +2109,7 @@ void CppGenerator::writeConverterRegister(TextStream &s, const AbstractMetaClass Qt::SkipEmptyParts); while (!lst.isEmpty()) { QString signature = lst.join(u"::"_s); - writeConversions(smartPointerName + u'<' + signature + u" >"_s); + writeConversions(smartPointerName + u'<' + signature + u'>'); lst.removeFirst(); } |