aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-20 19:59:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-20 19:59:29 +0200
commite8d90a9e62898d3b746772d9ae8542b87efcecf8 (patch)
treef4ad1e6906f5a9ea805b677d6d878204b64e85e3 /sources
parentf1bcf7d077282f9248aee570545765ef60af00e3 (diff)
parenta14ea7738f493280f5c7b6e4a8834a7d1daacd1e (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/PySide2/QtConcurrent/CMakeLists.txt4
-rw-r--r--sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml14
-rw-r--r--sources/pyside2/PySide2/QtCore/CMakeLists.txt1
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml15
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp6
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp7
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.h4
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp53
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp14
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testaddfunction.cpp16
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp8
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp2
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testcontainer.cpp3
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testconversionoperator.cpp24
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testconversionruletag.cpp5
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp2
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testenum.cpp60
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testextrainclude.cpp6
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testfunctiontag.cpp7
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testimplicitconversions.cpp8
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp4
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp8
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testnestedtypes.cpp10
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp28
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testrefcounttag.cpp4
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testreferencetopointer.cpp2
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testremovefield.cpp2
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testremoveimplconv.cpp3
-rw-r--r--sources/shiboken2/ApiExtractor/tests/testtemplates.cpp27
-rw-r--r--sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py10
30 files changed, 214 insertions, 143 deletions
diff --git a/sources/pyside2/PySide2/QtConcurrent/CMakeLists.txt b/sources/pyside2/PySide2/QtConcurrent/CMakeLists.txt
index 145a8bfc3..a6e8cd202 100644
--- a/sources/pyside2/PySide2/QtConcurrent/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtConcurrent/CMakeLists.txt
@@ -2,6 +2,10 @@ project(QtConcurrent)
set(QtConcurrent_SRC
${QtConcurrent_GEN_DIR}/qtconcurrent_wrapper.cpp
+${QtConcurrent_GEN_DIR}/qfuturevoid_wrapper.cpp
+${QtConcurrent_GEN_DIR}/qfutureqstring_wrapper.cpp
+${QtConcurrent_GEN_DIR}/qfuturewatchervoid_wrapper.cpp
+${QtConcurrent_GEN_DIR}/qfuturewatcherqstring_wrapper.cpp
# module is always needed
${QtConcurrent_GEN_DIR}/qtconcurrent_module_wrapper.cpp
)
diff --git a/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml b/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml
index 7e7bd9bcc..ea34150cd 100644
--- a/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml
+++ b/sources/pyside2/PySide2/QtConcurrent/typesystem_concurrent.xml
@@ -54,4 +54,18 @@
</extra-includes>
</namespace-type>
+ <typedef-type name="QFutureVoid" source="QFuture&lt;void&gt;" disable-wrapper="yes">
+ <include file-name="QtCore/qfuture.h" location="global"/>
+ <modify-function signature="isResultReadyAt(int) const" remove="all"/>
+ </typedef-type>
+ <typedef-type name="QFutureQString" source="QFuture&lt;QString&gt;" disable-wrapper="yes">
+ <include file-name="QtCore/qfuture.h" location="global"/>
+ </typedef-type>
+ <typedef-type name="QFutureWatcherVoid" source="QFutureWatcher&lt;void&gt;">
+ <include file-name="QtCore/qfuturewatcher.h" location="global"/>
+ </typedef-type>
+ <typedef-type name="QFutureWatcherQString" source="QFutureWatcher&lt;QString&gt;">
+ <include file-name="QtCore/qfuturewatcher.h" location="global"/>
+ </typedef-type>
+
</typesystem>
diff --git a/sources/pyside2/PySide2/QtCore/CMakeLists.txt b/sources/pyside2/PySide2/QtCore/CMakeLists.txt
index b6a374073..31c1db0ee 100644
--- a/sources/pyside2/PySide2/QtCore/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtCore/CMakeLists.txt
@@ -63,6 +63,7 @@ ${QtCore_GEN_DIR}/qfiledevice_wrapper.cpp
${QtCore_GEN_DIR}/qfileinfo_wrapper.cpp
${QtCore_GEN_DIR}/qfileselector_wrapper.cpp
${QtCore_GEN_DIR}/qfilesystemwatcher_wrapper.cpp
+${QtCore_GEN_DIR}/qfutureinterfacebase_wrapper.cpp
${QtCore_GEN_DIR}/qgenericargument_wrapper.cpp
${QtCore_GEN_DIR}/qgenericreturnargument_wrapper.cpp
${QtCore_GEN_DIR}/qidentityproxymodel_wrapper.cpp
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
index daa636f98..d20949a10 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -2714,6 +2714,21 @@
</modify-function>
</value-type>
+ <object-type name="QFutureInterfaceBase">
+ <enum-type name="State"/>
+ </object-type>
+ <value-type name="QFuture" generate="no">
+ <include file-name="QtCore/qfuture.h" location="global"/>
+ <modify-function signature="waitForFinished()" allow-thread="yes"/>
+ </value-type>
+ <object-type name="QFutureWatcherBase" generate="no">
+ <modify-function signature="futureInterface()" remove="all"/>
+ <modify-function signature="futureInterface() const" remove="all"/>
+ </object-type>
+ <object-type name="QFutureWatcher" generate="no">
+ <include file-name="QtCore/qfuturewatcher.h" location="global"/>
+ </object-type>
+
<value-type name="QGenericArgument">
<include file-name="qobjectdefs.h" location="global"/>
</value-type>
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index c8b9c173b..be285693e 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -1988,14 +1988,13 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const AddedFunction:
{
Q_ASSERT(!typeInfo.name.isEmpty());
TypeDatabase* typeDb = TypeDatabase::instance();
- TypeEntry* type;
QString typeName = typeInfo.name;
if (typeName == QLatin1String("void"))
return AbstractMetaType::createVoid();
- type = typeDb->findType(typeName);
+ TypeEntry *type = typeDb->findType(typeName);
if (!type)
type = typeDb->findFlagsType(typeName);
@@ -2056,6 +2055,8 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const AddedFunction:
metaType->addInstantiation(metaArgType);
}
metaType->setTypeUsagePattern(AbstractMetaType::ContainerPattern);
+ } else {
+ metaType->decideUsagePattern();
}
return metaType;
@@ -2376,6 +2377,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateTypeStatic(const TypeInfo
}
}
+ Q_ASSERT(metaType->typeUsagePattern() != AbstractMetaType::InvalidPattern);
return metaType.take();
}
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index 2f68dd743..c0b6fa481 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -315,8 +315,11 @@ QString AbstractMetaType::pythonSignature() const
AbstractMetaType::TypeUsagePattern AbstractMetaType::determineUsagePattern() const
{
- if (m_typeEntry->isTemplateArgument() || m_referenceType == RValueReference)
- return InvalidPattern;
+ if (m_typeEntry->isTemplateArgument())
+ return TemplateArgument;
+
+ if (m_typeEntry->type() == TypeEntry::ConstantValueType)
+ return NonTypeTemplateArgument;
if (m_typeEntry->isPrimitive() && (actualIndirections() == 0 || passByConstRef()))
return PrimitivePattern;
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h
index 154314d69..49078b07f 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h
@@ -294,7 +294,9 @@ public:
SmartPointerPattern,
VarargsPattern,
ArrayPattern,
- VoidPattern // Plain "void", no "void *" or similar.
+ VoidPattern, // Plain "void", no "void *" or similar.
+ TemplateArgument, // 'T' in std::array<T,2>
+ NonTypeTemplateArgument // '2' in in std::array<T,2>
};
Q_ENUM(TypeUsagePattern)
diff --git a/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp b/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp
index f0aa4a318..19bfb8464 100644
--- a/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testabstractmetaclass.cpp
@@ -57,7 +57,7 @@ void TestAbstractMetaClass::testClassNameUnderNamespace()
QVERIFY(!builder.isNull());
AbstractMetaClassList classes = builder->classes();
QCOMPARE(classes.count(), 2); // 1 namespace + 1 class
- if (classes.first()->name() != QLatin1String("ClassName"))
+ if (classes.constFirst()->name() != QLatin1String("ClassName"))
qSwap(classes[0], classes[1]);
QCOMPARE(classes[0]->name(), QLatin1String("ClassName"));
@@ -71,7 +71,7 @@ void TestAbstractMetaClass::testClassNameUnderNamespace()
AbstractMetaFunctionList ctors = classes[0]->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
- if (ctors.first()->minimalSignature() != QLatin1String("ClassName()"))
+ if (ctors.constFirst()->minimalSignature() != QLatin1String("ClassName()"))
qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 0);
@@ -149,9 +149,9 @@ public:
QVERIFY(f->attributes() & AbstractMetaAttributes::FinalCppClass);
// implementing class, ownclass, declaringclass
- AbstractMetaFunction* ctorA = a->queryFunctions(AbstractMetaClass::Constructors).first();
- AbstractMetaFunction* ctorB = b->queryFunctions(AbstractMetaClass::Constructors).first();
- AbstractMetaFunction* ctorC = c->queryFunctions(AbstractMetaClass::Constructors).first();
+ AbstractMetaFunction *ctorA = a->queryFunctions(AbstractMetaClass::Constructors).constFirst();
+ AbstractMetaFunction *ctorB = b->queryFunctions(AbstractMetaClass::Constructors).constFirst();
+ AbstractMetaFunction *ctorC = c->queryFunctions(AbstractMetaClass::Constructors).constFirst();
QVERIFY(ctorA->isConstructor());
QVERIFY(!ctorA->isVirtual());
QVERIFY(ctorB->isConstructor());
@@ -241,8 +241,8 @@ void TestAbstractMetaClass::testDefaultValues()
QCOMPARE(classes.count(), 2);
AbstractMetaClass* classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QCOMPARE(classA->queryFunctionsByName(QLatin1String("method")).count(), 1);
- AbstractMetaFunction* method = classA->queryFunctionsByName(QLatin1String("method")).first();
- AbstractMetaArgument* arg = method->arguments().first();
+ AbstractMetaFunction* method = classA->queryFunctionsByName(QLatin1String("method")).constFirst();
+ AbstractMetaArgument* arg = method->arguments().constFirst();
QCOMPARE(arg->defaultValueExpression(), arg->originalDefaultValueExpression());
}
@@ -270,8 +270,8 @@ void TestAbstractMetaClass::testModifiedDefaultValues()
QCOMPARE(classes.count(), 2);
AbstractMetaClass* classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QCOMPARE(classA->queryFunctionsByName(QLatin1String("method")).count(), 1);
- AbstractMetaFunction* method = classA->queryFunctionsByName(QLatin1String("method")).first();
- AbstractMetaArgument* arg = method->arguments().first();
+ AbstractMetaFunction *method = classA->queryFunctionsByName(QLatin1String("method")).constFirst();
+ AbstractMetaArgument *arg = method->arguments().constFirst();
QCOMPARE(arg->defaultValueExpression(), QLatin1String("Hello"));
QCOMPARE(arg->originalDefaultValueExpression(), QLatin1String("A::B()"));
}
@@ -357,21 +357,22 @@ void TestAbstractMetaClass::testSpecialFunctions()
QVERIFY(classA);
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
- QCOMPARE(ctors.first()->functionType(), AbstractMetaFunction::ConstructorFunction);
+ QCOMPARE(ctors.constFirst()->functionType(), AbstractMetaFunction::ConstructorFunction);
QCOMPARE(ctors.at(1)->functionType(), AbstractMetaFunction::CopyConstructorFunction);
AbstractMetaFunctionList assigmentOps = classA->queryFunctionsByName(QLatin1String("operator="));
QCOMPARE(assigmentOps.size(), 1);
- QCOMPARE(assigmentOps.first()->functionType(), AbstractMetaFunction::AssignmentOperatorFunction);
+ QCOMPARE(assigmentOps.constFirst()->functionType(),
+ AbstractMetaFunction::AssignmentOperatorFunction);
const AbstractMetaClass *classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
QVERIFY(classB);
ctors = classB->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
- QCOMPARE(ctors.first()->functionType(), AbstractMetaFunction::ConstructorFunction);
+ QCOMPARE(ctors.constFirst()->functionType(), AbstractMetaFunction::ConstructorFunction);
QCOMPARE(ctors.at(1)->functionType(), AbstractMetaFunction::CopyConstructorFunction);
assigmentOps = classA->queryFunctionsByName(QLatin1String("operator="));
QCOMPARE(assigmentOps.size(), 1);
- QCOMPARE(assigmentOps.first()->functionType(), AbstractMetaFunction::AssignmentOperatorFunction);
+ QCOMPARE(assigmentOps.constFirst()->functionType(), AbstractMetaFunction::AssignmentOperatorFunction);
}
void TestAbstractMetaClass::testClassDefaultConstructors()
@@ -424,7 +425,7 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
- if (ctors.first()->minimalSignature() != QLatin1String("A()"))
+ if (ctors.constFirst()->minimalSignature() != QLatin1String("A()"))
qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 0);
@@ -435,18 +436,18 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
AbstractMetaClass* classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
QVERIFY(classB);
QCOMPARE(classB->functions().size(), 2);
- QCOMPARE(classB->functions().first()->minimalSignature(), QLatin1String("B()"));
+ QCOMPARE(classB->functions().constFirst()->minimalSignature(), QLatin1String("B()"));
AbstractMetaClass* classC = AbstractMetaClass::findClass(classes, QLatin1String("C"));
QVERIFY(classC);
QCOMPARE(classC->functions().size(), 1);
- QCOMPARE(classC->functions().first()->minimalSignature(), QLatin1String("C(C)"));
+ QCOMPARE(classC->functions().constFirst()->minimalSignature(), QLatin1String("C(C)"));
AbstractMetaClass* classD = AbstractMetaClass::findClass(classes, QLatin1String("D"));
QVERIFY(classD);
QCOMPARE(classD->functions().size(), 1);
- QCOMPARE(classD->functions().first()->minimalSignature(), QLatin1String("D(D)"));
- QVERIFY(classD->functions().first()->isPrivate());
+ QCOMPARE(classD->functions().constFirst()->minimalSignature(), QLatin1String("D(D)"));
+ QVERIFY(classD->functions().constFirst()->isPrivate());
AbstractMetaClass* classE = AbstractMetaClass::findClass(classes, QLatin1String("E"));
QVERIFY(classE);
@@ -458,7 +459,7 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
ctors = classF->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
- if (ctors.first()->minimalSignature() != QLatin1String("F(int,int)"))
+ if (ctors.constFirst()->minimalSignature() != QLatin1String("F(int,int)"))
qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 2);
@@ -491,7 +492,7 @@ void TestAbstractMetaClass::testClassInheritedDefaultConstructors()
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
- if (ctors.first()->minimalSignature() != QLatin1String("A()"))
+ if (ctors.constFirst()->minimalSignature() != QLatin1String("A()"))
qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 0);
@@ -505,8 +506,8 @@ void TestAbstractMetaClass::testClassInheritedDefaultConstructors()
ctors = classB->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 1);
- QCOMPARE(ctors.first()->arguments().size(), 0);
- QCOMPARE(ctors.first()->minimalSignature(), QLatin1String("B()"));
+ QCOMPARE(ctors.constFirst()->arguments().size(), 0);
+ QCOMPARE(ctors.constFirst()->minimalSignature(), QLatin1String("B()"));
}
void TestAbstractMetaClass::testAbstractClassDefaultConstructors()
@@ -529,8 +530,8 @@ void TestAbstractMetaClass::testAbstractClassDefaultConstructors()
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 1);
- QCOMPARE(ctors.first()->arguments().size(), 0);
- QCOMPARE(ctors.first()->minimalSignature(), QLatin1String("A()"));
+ QCOMPARE(ctors.constFirst()->arguments().size(), 0);
+ QCOMPARE(ctors.constFirst()->minimalSignature(), QLatin1String("A()"));
}
void TestAbstractMetaClass::testObjectTypesMustNotHaveCopyConstructors()
@@ -550,8 +551,8 @@ void TestAbstractMetaClass::testObjectTypesMustNotHaveCopyConstructors()
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 1);
- QCOMPARE(ctors.first()->arguments().size(), 0);
- QCOMPARE(ctors.first()->minimalSignature(), QLatin1String("A()"));
+ QCOMPARE(ctors.constFirst()->arguments().size(), 0);
+ QCOMPARE(ctors.constFirst()->minimalSignature(), QLatin1String("A()"));
}
void TestAbstractMetaClass::testIsPolymorphic()
diff --git a/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp b/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp
index 63434b3a5..980d08489 100644
--- a/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp
@@ -73,7 +73,7 @@ void TestAbstractMetaType::testConstCharPtrType()
QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode));
QVERIFY(!builder.isNull());
QCOMPARE(builder->globalFunctions().size(), 1);
- AbstractMetaFunction* func = builder->globalFunctions().first();
+ AbstractMetaFunction *func = builder->globalFunctions().constFirst();
AbstractMetaType* rtype = func->type();
// Test properties of const char*
QVERIFY(rtype);
@@ -142,11 +142,11 @@ void TestAbstractMetaType::testCharType()
AbstractMetaClassList classes = builder->classes();
QCOMPARE(classes.size(), 1);
- QCOMPARE(classes.first()->package(), QLatin1String("Foo"));
+ QCOMPARE(classes.constFirst()->package(), QLatin1String("Foo"));
AbstractMetaFunctionList functions = builder->globalFunctions();
QCOMPARE(functions.size(), 1);
- AbstractMetaFunction* func = functions.first();
+ AbstractMetaFunction *func = functions.constFirst();
AbstractMetaType* rtype = func->type();
// Test properties of const char*
QVERIFY(rtype);
@@ -206,10 +206,10 @@ void TestAbstractMetaType::testTypedefWithTemplates()
QCOMPARE(classes.size(), 1);
AbstractMetaFunctionList functions = builder->globalFunctions();
QCOMPARE(functions.count(), 1);
- AbstractMetaFunction* function = functions.first();
+ AbstractMetaFunction *function = functions.constFirst();
AbstractMetaArgumentList args = function->arguments();
QCOMPARE(args.count(), 1);
- AbstractMetaArgument* arg = args.first();
+ AbstractMetaArgument *arg = args.constFirst();
AbstractMetaType* metaType = arg->type();
QCOMPARE(metaType->cppSignature(), QLatin1String("A<B >"));
}
@@ -233,11 +233,11 @@ void TestAbstractMetaType::testObjectTypeUsedAsValue()
QVERIFY(classA);
AbstractMetaFunctionList overloads = classA->queryFunctionsByName(QLatin1String("method"));
QCOMPARE(overloads.count(), 1);
- AbstractMetaFunction* method = overloads.first();
+ AbstractMetaFunction* method = overloads.constFirst();
QVERIFY(method);
AbstractMetaArgumentList args = method->arguments();
QCOMPARE(args.count(), 1);
- AbstractMetaArgument* arg = args.first();
+ AbstractMetaArgument* arg = args.constFirst();
AbstractMetaType* metaType = arg->type();
QCOMPARE(metaType->cppSignature(), QLatin1String("A"));
QVERIFY(metaType->isValue());
diff --git a/sources/shiboken2/ApiExtractor/tests/testaddfunction.cpp b/sources/shiboken2/ApiExtractor/tests/testaddfunction.cpp
index a131e7fe2..46307f94c 100644
--- a/sources/shiboken2/ApiExtractor/tests/testaddfunction.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testaddfunction.cpp
@@ -140,7 +140,7 @@ void TestAddFunction::testAddFunctionConstructor()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
QCOMPARE(classA->functions().count(), 3); // default and added ctors
- AbstractMetaFunction* addedFunc = classA->functions().last();
+ AbstractMetaFunction *addedFunc = classA->functions().constLast();
QCOMPARE(addedFunc->visibility(), AbstractMetaFunction::Public);
QCOMPARE(addedFunc->functionType(), AbstractMetaFunction::ConstructorFunction);
QCOMPARE(addedFunc->arguments().size(), 1);
@@ -163,7 +163,7 @@ void TestAddFunction::testAddFunctionTagDefaultValues()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
QCOMPARE(classA->functions().count(), 3); // default ctor, default copy ctor and the added function
- AbstractMetaFunction* addedFunc = classA->functions().last();
+ AbstractMetaFunction *addedFunc = classA->functions().constLast();
QCOMPARE(addedFunc->visibility(), AbstractMetaFunction::Public);
QCOMPARE(addedFunc->functionType(), AbstractMetaFunction::NormalFunction);
QVERIFY(addedFunc->isUserAdded());
@@ -187,7 +187,7 @@ void TestAddFunction::testAddFunctionCodeSnippets()
AbstractMetaClassList classes = builder->classes();
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
- AbstractMetaFunction* addedFunc = classA->functions().last();
+ AbstractMetaFunction *addedFunc = classA->functions().constLast();
QVERIFY(addedFunc->hasInjectedCode());
}
@@ -281,8 +281,8 @@ void TestAddFunction::testAddFunctionAtModuleLevel()
const FunctionModificationList mods = addedFuncs.constFirst()->modifications;
QCOMPARE(mods.size(), 1);
- QVERIFY(mods.first().isCodeInjection());
- CodeSnip snip = mods.first().snips.first();
+ QVERIFY(mods.constFirst().isCodeInjection());
+ CodeSnip snip = mods.constFirst().snips.constFirst();
QCOMPARE(snip.code().trimmed(), QLatin1String("custom_code();"));
}
@@ -312,7 +312,7 @@ void TestAddFunction::testAddFunctionWithVarargs()
QVERIFY(classA);
const AbstractMetaFunction* addedFunc = classA->findFunction(QLatin1String("func"));
QVERIFY(addedFunc);
- const AbstractMetaArgument* arg = addedFunc->arguments().last();
+ const AbstractMetaArgument *arg = addedFunc->arguments().constLast();
QVERIFY(arg->type()->isVarargs());
QVERIFY(arg->type()->typeEntry()->isVarargs());
}
@@ -458,8 +458,8 @@ void TestAddFunction::testAddFunctionWithTemplateArg()
QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode));
QVERIFY(!builder.isNull());
QCOMPARE(builder->globalFunctions().size(), 1);
- AbstractMetaFunction* func = builder->globalFunctions().first();
- AbstractMetaArgument* arg = func->arguments().first();
+ AbstractMetaFunction *func = builder->globalFunctions().constFirst();
+ AbstractMetaArgument *arg = func->arguments().constFirst();
QCOMPARE(arg->type()->instantiations().count(), 1);
}
diff --git a/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp b/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp
index a8b9a2eff..b7b5ead17 100644
--- a/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testarrayargument.cpp
@@ -52,7 +52,7 @@ void TestArrayArgument::testArrayArgumentWithSizeDefinedByInteger()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(builder->classes(), QLatin1String("A"));
QVERIFY(classA);
- const AbstractMetaArgument* arg = classA->functions().last()->arguments().first();
+ const AbstractMetaArgument *arg = classA->functions().constLast()->arguments().constFirst();
QVERIFY(arg->type()->isArray());
QCOMPARE(arg->type()->arrayElementCount(), 3);
QCOMPARE(arg->type()->arrayElementType()->name(), QLatin1String("double"));
@@ -131,7 +131,7 @@ void TestArrayArgument::testArrayArgumentWithSizeDefinedByEnumValue()
AbstractMetaEnumValue *nvalues = classA->findEnumValue(QLatin1String("NValues"));
QVERIFY(nvalues);
- const AbstractMetaArgument* arg = classA->functions().last()->arguments().first();
+ const AbstractMetaArgument *arg = classA->functions().constLast()->arguments().constFirst();
QVERIFY(arg->type()->isArray());
QCOMPARE(arg->type()->arrayElementCount(), nvalues->value().value());
QCOMPARE(arg->type()->arrayElementType()->name(), QLatin1String("double"));
@@ -157,12 +157,12 @@ void TestArrayArgument::testArrayArgumentWithSizeDefinedByEnumValueFromGlobalEnu
const AbstractMetaClass *classA = AbstractMetaClass::findClass(builder->classes(), QLatin1String("A"));
QVERIFY(classA);
- AbstractMetaEnum* someEnum = builder->globalEnums().first();
+ AbstractMetaEnum *someEnum = builder->globalEnums().constFirst();
QVERIFY(someEnum);
const AbstractMetaEnumValue *nvalues = someEnum->findEnumValue(QLatin1String("NValues"));
QVERIFY(nvalues);
- const AbstractMetaArgument* arg = classA->functions().last()->arguments().first();
+ const AbstractMetaArgument *arg = classA->functions().constLast()->arguments().constFirst();
QVERIFY(arg->type()->isArray());
QCOMPARE(arg->type()->arrayElementCount(), nvalues->value().value());
QCOMPARE(arg->type()->arrayElementType()->name(), QLatin1String("double"));
diff --git a/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp b/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp
index aeca2d3f4..eed35552e 100644
--- a/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testcodeinjection.cpp
@@ -79,7 +79,7 @@ void TestCodeInjections::testReadFile()
AbstractMetaClassList classes = builder->classes();
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QCOMPARE(classA->typeEntry()->codeSnips().count(), 1);
- QString code = classA->typeEntry()->codeSnips().first().code();
+ QString code = classA->typeEntry()->codeSnips().constFirst().code();
QVERIFY(code.indexOf(expected) != -1);
code = classA->typeEntry()->conversionRule();
QVERIFY(code.indexOf(expected) != -1);
diff --git a/sources/shiboken2/ApiExtractor/tests/testcontainer.cpp b/sources/shiboken2/ApiExtractor/tests/testcontainer.cpp
index aaa72238c..0da16924a 100644
--- a/sources/shiboken2/ApiExtractor/tests/testcontainer.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testcontainer.cpp
@@ -91,7 +91,8 @@ void TestContainer::testListOfValueType()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
QCOMPARE(classA->templateBaseClassInstantiations().count(), 1);
- const AbstractMetaType* templateInstanceType = classA->templateBaseClassInstantiations().first();
+ const AbstractMetaType *templateInstanceType =
+ classA->templateBaseClassInstantiations().constFirst();
QVERIFY(templateInstanceType);
QCOMPARE(templateInstanceType->indirections(), 0);
diff --git a/sources/shiboken2/ApiExtractor/tests/testconversionoperator.cpp b/sources/shiboken2/ApiExtractor/tests/testconversionoperator.cpp
index 142c783a4..2af427294 100644
--- a/sources/shiboken2/ApiExtractor/tests/testconversionoperator.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testconversionoperator.cpp
@@ -148,11 +148,15 @@ void TestConversionOperator::testConversionOperatorReturningReference()
QCOMPARE(classA->functions().count(), 2);
QCOMPARE(classB->functions().count(), 3);
QCOMPARE(classA->externalConversionOperators().count(), 1);
- QCOMPARE(classA->externalConversionOperators().first()->type()->cppSignature(), QLatin1String("A"));
- QCOMPARE(classA->externalConversionOperators().first()->ownerClass()->name(), QLatin1String("B"));
+ QCOMPARE(classA->externalConversionOperators().constFirst()->type()->cppSignature(),
+ QLatin1String("A"));
+ QCOMPARE(classA->externalConversionOperators().constFirst()->ownerClass()->name(),
+ QLatin1String("B"));
QCOMPARE(classA->implicitConversions().count(), 1);
- QCOMPARE(classA->implicitConversions().first()->type()->cppSignature(), QLatin1String("A"));
- QCOMPARE(classA->implicitConversions().first()->ownerClass()->name(), QLatin1String("B"));
+ QCOMPARE(classA->implicitConversions().constFirst()->type()->cppSignature(),
+ QLatin1String("A"));
+ QCOMPARE(classA->implicitConversions().constFirst()->ownerClass()->name(),
+ QLatin1String("B"));
}
void TestConversionOperator::testConversionOperatorReturningConstReference()
@@ -178,11 +182,15 @@ void TestConversionOperator::testConversionOperatorReturningConstReference()
QCOMPARE(classA->functions().count(), 2);
QCOMPARE(classB->functions().count(), 3);
QCOMPARE(classA->externalConversionOperators().count(), 1);
- QCOMPARE(classA->externalConversionOperators().first()->type()->cppSignature(), QLatin1String("A"));
- QCOMPARE(classA->externalConversionOperators().first()->ownerClass()->name(), QLatin1String("B"));
+ QCOMPARE(classA->externalConversionOperators().constFirst()->type()->cppSignature(),
+ QLatin1String("A"));
+ QCOMPARE(classA->externalConversionOperators().constFirst()->ownerClass()->name(),
+ QLatin1String("B"));
QCOMPARE(classA->implicitConversions().count(), 1);
- QCOMPARE(classA->implicitConversions().first()->type()->cppSignature(), QLatin1String("A"));
- QCOMPARE(classA->implicitConversions().first()->ownerClass()->name(), QLatin1String("B"));
+ QCOMPARE(classA->implicitConversions().constFirst()->type()->cppSignature(),
+ QLatin1String("A"));
+ QCOMPARE(classA->implicitConversions().constFirst()->ownerClass()->name(),
+ QLatin1String("B"));
}
QTEST_APPLESS_MAIN(TestConversionOperator)
diff --git a/sources/shiboken2/ApiExtractor/tests/testconversionruletag.cpp b/sources/shiboken2/ApiExtractor/tests/testconversionruletag.cpp
index aa2bec5d6..15a9231ff 100644
--- a/sources/shiboken2/ApiExtractor/tests/testconversionruletag.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testconversionruletag.cpp
@@ -179,7 +179,8 @@ if (!TargetDateTimeAPI) TargetDateTime_IMPORT;\n\
QVERIFY(conversion->hasTargetToNativeConversions());
QCOMPARE(conversion->targetToNativeConversions().size(), 1);
- CustomConversion::TargetToNativeConversion* toNative = conversion->targetToNativeConversions().first();
+ CustomConversion::TargetToNativeConversion *toNative =
+ conversion->targetToNativeConversions().constFirst();
QVERIFY(toNative);
QCOMPARE(toNative->sourceTypeName(), QLatin1String("TargetDate"));
QVERIFY(toNative->isCustomType());
@@ -241,7 +242,7 @@ void TestConversionRuleTag::testConversionRuleTagWithInsertTemplate()
QVERIFY(conversion->hasTargetToNativeConversions());
QCOMPARE(conversion->targetToNativeConversions().size(), 1);
- CustomConversion::TargetToNativeConversion* toNative = conversion->targetToNativeConversions().first();
+ CustomConversion::TargetToNativeConversion* toNative = conversion->targetToNativeConversions().constFirst();
QVERIFY(toNative);
QCOMPARE(toNative->conversion().trimmed(),
QLatin1String(targetToNativeExpected));
diff --git a/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp b/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp
index 7b3da182f..786c3717e 100644
--- a/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp
@@ -87,7 +87,7 @@ void TestDropTypeEntries::testDropEntries()
AbstractMetaEnumList globalEnums = builder->globalEnums();
QCOMPARE(globalEnums.count(), 1);
- QCOMPARE(globalEnums.first()->name(), QLatin1String("EnumA"));
+ QCOMPARE(globalEnums.constFirst()->name(), QLatin1String("EnumA"));
TypeDatabase* td = TypeDatabase::instance();
QVERIFY(td->findType(QLatin1String("funcA")));
diff --git a/sources/shiboken2/ApiExtractor/tests/testenum.cpp b/sources/shiboken2/ApiExtractor/tests/testenum.cpp
index c04a37d9d..82cdd291c 100644
--- a/sources/shiboken2/ApiExtractor/tests/testenum.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testenum.cpp
@@ -58,31 +58,32 @@ void TestEnum::testEnumCppSignature()
AbstractMetaEnumList globalEnums = builder->globalEnums();
QCOMPARE(globalEnums.count(), 1);
- QCOMPARE(globalEnums.first()->name(), QLatin1String("GlobalEnum"));
+ QCOMPARE(globalEnums.constFirst()->name(), QLatin1String("GlobalEnum"));
// enum as parameter of a function
AbstractMetaFunctionList functions = builder->globalFunctions();
QCOMPARE(functions.count(), 1);
- QCOMPARE(functions.first()->arguments().count(), 1);
- QCOMPARE(functions.first()->arguments().first()->type()->cppSignature(), QLatin1String("A::ClassEnum"));
+ QCOMPARE(functions.constFirst()->arguments().count(), 1);
+ QCOMPARE(functions.constFirst()->arguments().constFirst()->type()->cppSignature(),
+ QLatin1String("A::ClassEnum"));
// enum as parameter of a method
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QCOMPARE(classA->enums().count(), 1);
AbstractMetaFunctionList funcs = classA->queryFunctionsByName(QLatin1String("method"));
QVERIFY(!funcs.isEmpty());
- AbstractMetaFunction* method = funcs.first();
+ AbstractMetaFunction *method = funcs.constFirst();
QVERIFY(method);
- AbstractMetaArgument* arg = method->arguments().first();
+ AbstractMetaArgument *arg = method->arguments().constFirst();
QCOMPARE(arg->type()->name(), QLatin1String("ClassEnum"));
QCOMPARE(arg->type()->cppSignature(), QLatin1String("A::ClassEnum"));
- QCOMPARE(functions.first()->arguments().count(), 1);
- arg = functions.first()->arguments().first();
+ QCOMPARE(functions.constFirst()->arguments().count(), 1);
+ arg = functions.constFirst()->arguments().constFirst();
QCOMPARE(arg->type()->name(), QLatin1String("ClassEnum"));
QCOMPARE(arg->type()->cppSignature(), QLatin1String("A::ClassEnum"));
AbstractMetaEnumList classEnums = classA->enums();
- QCOMPARE(classEnums.first()->name(), QLatin1String("ClassEnum"));
+ QCOMPARE(classEnums.constFirst()->name(), QLatin1String("ClassEnum"));
AbstractMetaEnumValue *e = AbstractMetaClass::findEnumValue(classes, QLatin1String("CA"));
QVERIFY(e);
e = AbstractMetaClass::findEnumValue(classes, QLatin1String("ClassEnum::CA"));
@@ -136,8 +137,9 @@ void TestEnum::testAnonymousEnum()
AbstractMetaEnumList globalEnums = builder->globalEnums();
QCOMPARE(globalEnums.count(), 1);
- QCOMPARE(globalEnums.first()->typeEntry()->qualifiedCppName(), QLatin1String("Global0"));
- QVERIFY(globalEnums.first()->isAnonymous());
+ QCOMPARE(globalEnums.constFirst()->typeEntry()->qualifiedCppName(),
+ QLatin1String("Global0"));
+ QVERIFY(globalEnums.constFirst()->isAnonymous());
AbstractMetaClassList classes = builder->classes();
QCOMPARE(classes.count(), 1);
@@ -148,12 +150,12 @@ void TestEnum::testAnonymousEnum()
QVERIFY(anonEnumA1->isAnonymous());
QCOMPARE(anonEnumA1->typeEntry()->qualifiedCppName(), QLatin1String("A::A1"));
- AbstractMetaEnumValue* enumValueA0 = anonEnumA1->values().first();
+ AbstractMetaEnumValue* enumValueA0 = anonEnumA1->values().constFirst();
QCOMPARE(enumValueA0->name(), QLatin1String("A0"));
QCOMPARE(enumValueA0->value().value(), 0);
QCOMPARE(enumValueA0->stringValue(), QString());
- AbstractMetaEnumValue* enumValueA1 = anonEnumA1->values().last();
+ AbstractMetaEnumValue *enumValueA1 = anonEnumA1->values().constLast();
QCOMPARE(enumValueA1->name(), QLatin1String("A1"));
QCOMPARE(enumValueA1->value().value(), 1);
QCOMPARE(enumValueA1->stringValue(), QString());
@@ -163,12 +165,12 @@ void TestEnum::testAnonymousEnum()
QVERIFY(anonEnumIsThis->isAnonymous());
QCOMPARE(anonEnumIsThis->typeEntry()->qualifiedCppName(), QLatin1String("A::isThis"));
- AbstractMetaEnumValue* enumValueIsThis = anonEnumIsThis->values().first();
+ AbstractMetaEnumValue* enumValueIsThis = anonEnumIsThis->values().constFirst();
QCOMPARE(enumValueIsThis->name(), QLatin1String("isThis"));
QCOMPARE(enumValueIsThis->value().value(), static_cast<int>(true));
QCOMPARE(enumValueIsThis->stringValue(), QLatin1String("true"));
- AbstractMetaEnumValue* enumValueIsThat = anonEnumIsThis->values().last();
+ AbstractMetaEnumValue *enumValueIsThat = anonEnumIsThis->values().constLast();
QCOMPARE(enumValueIsThat->name(), QLatin1String("isThat"));
QCOMPARE(enumValueIsThat->value().value(), static_cast<int>(false));
QCOMPARE(enumValueIsThat->stringValue(), QLatin1String("false"));
@@ -191,28 +193,28 @@ void TestEnum::testGlobalEnums()
AbstractMetaEnumList globalEnums = builder->globalEnums();
QCOMPARE(globalEnums.count(), 2);
- AbstractMetaEnum* enumA = globalEnums.first();
+ AbstractMetaEnum *enumA = globalEnums.constFirst();
QCOMPARE(enumA->typeEntry()->qualifiedCppName(), QLatin1String("EnumA"));
- AbstractMetaEnumValue* enumValueA0 = enumA->values().first();
+ AbstractMetaEnumValue *enumValueA0 = enumA->values().constFirst();
QCOMPARE(enumValueA0->name(), QLatin1String("A0"));
QCOMPARE(enumValueA0->value().value(), 0);
QCOMPARE(enumValueA0->stringValue(), QString());
- AbstractMetaEnumValue* enumValueA1 = enumA->values().last();
+ AbstractMetaEnumValue *enumValueA1 = enumA->values().constLast();
QCOMPARE(enumValueA1->name(), QLatin1String("A1"));
QCOMPARE(enumValueA1->value().value(), 1);
QCOMPARE(enumValueA1->stringValue(), QString());
- AbstractMetaEnum* enumB = globalEnums.last();
+ AbstractMetaEnum *enumB = globalEnums.constLast();
QCOMPARE(enumB->typeEntry()->qualifiedCppName(), QLatin1String("EnumB"));
- AbstractMetaEnumValue* enumValueB0 = enumB->values().first();
+ AbstractMetaEnumValue* enumValueB0 = enumB->values().constFirst();
QCOMPARE(enumValueB0->name(), QLatin1String("B0"));
QCOMPARE(enumValueB0->value().value(), 2);
QCOMPARE(enumValueB0->stringValue(), QLatin1String("2"));
- AbstractMetaEnumValue* enumValueB1 = enumB->values().last();
+ AbstractMetaEnumValue *enumValueB1 = enumB->values().constLast();
QCOMPARE(enumValueB1->name(), QLatin1String("B1"));
QCOMPARE(enumValueB1->value().value(), 4);
QCOMPARE(enumValueB1->stringValue(), QLatin1String("0x4"));
@@ -244,12 +246,12 @@ void TestEnum::testEnumValueFromNeighbourEnum()
QVERIFY(enumA);
QCOMPARE(enumA->typeEntry()->qualifiedCppName(), QLatin1String("A::EnumA"));
- AbstractMetaEnumValue* enumValueA0 = enumA->values().first();
+ AbstractMetaEnumValue* enumValueA0 = enumA->values().constFirst();
QCOMPARE(enumValueA0->name(), QLatin1String("ValueA0"));
QCOMPARE(enumValueA0->value().value(), 0);
QCOMPARE(enumValueA0->stringValue(), QString());
- AbstractMetaEnumValue* enumValueA1 = enumA->values().last();
+ AbstractMetaEnumValue* enumValueA1 = enumA->values().constLast();
QCOMPARE(enumValueA1->name(), QLatin1String("ValueA1"));
QCOMPARE(enumValueA1->value().value(), 1);
QCOMPARE(enumValueA1->stringValue(), QString());
@@ -258,12 +260,12 @@ void TestEnum::testEnumValueFromNeighbourEnum()
QVERIFY(enumB);
QCOMPARE(enumB->typeEntry()->qualifiedCppName(), QLatin1String("A::EnumB"));
- AbstractMetaEnumValue* enumValueB0 = enumB->values().first();
+ AbstractMetaEnumValue *enumValueB0 = enumB->values().constFirst();
QCOMPARE(enumValueB0->name(), QLatin1String("ValueB0"));
QCOMPARE(enumValueB0->value().value(), 1);
QCOMPARE(enumValueB0->stringValue(), QLatin1String("A::ValueA1"));
- AbstractMetaEnumValue* enumValueB1 = enumB->values().last();
+ AbstractMetaEnumValue *enumValueB1 = enumB->values().constLast();
QCOMPARE(enumValueB1->name(), QLatin1String("ValueB1"));
QCOMPARE(enumValueB1->value().value(), 0);
QCOMPARE(enumValueB1->stringValue(), QLatin1String("ValueA0"));
@@ -389,12 +391,12 @@ void TestEnum::testPrivateEnum()
QVERIFY(publicEnum);
QCOMPARE(publicEnum->typeEntry()->qualifiedCppName(), QLatin1String("A::PublicEnum"));
- AbstractMetaEnumValue* pub0 = publicEnum->values().first();
+ AbstractMetaEnumValue *pub0 = publicEnum->values().constFirst();
QCOMPARE(pub0->name(), QLatin1String("Pub0"));
QCOMPARE(pub0->value().value(), 0x0f);
QCOMPARE(pub0->stringValue(), QLatin1String("Priv0"));
- AbstractMetaEnumValue* pub1 = publicEnum->values().last();
+ AbstractMetaEnumValue *pub1 = publicEnum->values().constLast();
QCOMPARE(pub1->name(), QLatin1String("Pub1"));
QCOMPARE(pub1->value().value(), 0xf0);
QCOMPARE(pub1->stringValue(), QLatin1String("A::Priv1"));
@@ -418,15 +420,15 @@ void TestEnum::testTypedefEnum()
AbstractMetaEnumList globalEnums = builder->globalEnums();
QCOMPARE(globalEnums.count(), 1);
- AbstractMetaEnum* enumA = globalEnums.first();
+ AbstractMetaEnum *enumA = globalEnums.constFirst();
QCOMPARE(enumA->typeEntry()->qualifiedCppName(), QLatin1String("EnumA"));
- AbstractMetaEnumValue* enumValueA0 = enumA->values().first();
+ AbstractMetaEnumValue *enumValueA0 = enumA->values().constFirst();
QCOMPARE(enumValueA0->name(), QLatin1String("A0"));
QCOMPARE(enumValueA0->value().value(), 0);
QCOMPARE(enumValueA0->stringValue(), QLatin1String(""));
- AbstractMetaEnumValue* enumValueA1 = enumA->values().last();
+ AbstractMetaEnumValue *enumValueA1 = enumA->values().constLast();
QCOMPARE(enumValueA1->name(), QLatin1String("A1"));
QCOMPARE(enumValueA1->value().value(), 1);
QCOMPARE(enumValueA1->stringValue(), QString());
diff --git a/sources/shiboken2/ApiExtractor/tests/testextrainclude.cpp b/sources/shiboken2/ApiExtractor/tests/testextrainclude.cpp
index 7e5664842..565f157e1 100644
--- a/sources/shiboken2/ApiExtractor/tests/testextrainclude.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testextrainclude.cpp
@@ -52,7 +52,7 @@ void TestExtraInclude::testClassExtraInclude()
QVector<Include> includes = classA->typeEntry()->extraIncludes();
QCOMPARE(includes.count(), 1);
- QCOMPARE(includes.first().name(), QLatin1String("header.h"));
+ QCOMPARE(includes.constFirst().name(), QLatin1String("header.h"));
}
void TestExtraInclude::testGlobalExtraIncludes()
@@ -79,8 +79,8 @@ void TestExtraInclude::testGlobalExtraIncludes()
QVector<Include> includes = module->extraIncludes();
QCOMPARE(includes.count(), 2);
- QCOMPARE(includes.first().name(), QLatin1String("header1.h"));
- QCOMPARE(includes.last().name(), QLatin1String("header2.h"));
+ QCOMPARE(includes.constFirst().name(), QLatin1String("header1.h"));
+ QCOMPARE(includes.constLast().name(), QLatin1String("header2.h"));
}
QTEST_APPLESS_MAIN(TestExtraInclude)
diff --git a/sources/shiboken2/ApiExtractor/tests/testfunctiontag.cpp b/sources/shiboken2/ApiExtractor/tests/testfunctiontag.cpp
index b9aee5824..b942ea9b5 100644
--- a/sources/shiboken2/ApiExtractor/tests/testfunctiontag.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testfunctiontag.cpp
@@ -81,12 +81,13 @@ void TestFunctionTag::testRenameGlobalFunction()
QVERIFY(func);
QCOMPARE(builder->globalFunctions().size(), 1);
- const AbstractMetaFunction* metaFunc = builder->globalFunctions().first();
+ const AbstractMetaFunction *metaFunc = builder->globalFunctions().constFirst();
QVERIFY(metaFunc);
QCOMPARE(metaFunc->modifications().size(), 1);
- QVERIFY(metaFunc->modifications().first().isRenameModifier());
- QCOMPARE(metaFunc->modifications().first().renamedTo(), QLatin1String("smooth"));
+ QVERIFY(metaFunc->modifications().constFirst().isRenameModifier());
+ QCOMPARE(metaFunc->modifications().constFirst().renamedTo(),
+ QLatin1String("smooth"));
QCOMPARE(metaFunc->name(), QLatin1String("smooth"));
QCOMPARE(metaFunc->originalName(), QLatin1String("global_function_with_ugly_name"));
diff --git a/sources/shiboken2/ApiExtractor/tests/testimplicitconversions.cpp b/sources/shiboken2/ApiExtractor/tests/testimplicitconversions.cpp
index 26fb148d5..f960fca2f 100644
--- a/sources/shiboken2/ApiExtractor/tests/testimplicitconversions.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testimplicitconversions.cpp
@@ -59,7 +59,8 @@ void TestImplicitConversions::testWithPrivateCtors()
const AbstractMetaClass *classC = AbstractMetaClass::findClass(classes, QLatin1String("C"));
AbstractMetaFunctionList implicitConvs = classA->implicitConversions();
QCOMPARE(implicitConvs.count(), 1);
- QCOMPARE(implicitConvs.first()->arguments().first()->type()->typeEntry(), classC->typeEntry());
+ QCOMPARE(implicitConvs.constFirst()->arguments().constFirst()->type()->typeEntry(),
+ classC->typeEntry());
}
void TestImplicitConversions::testWithModifiedVisibility()
@@ -88,7 +89,8 @@ void TestImplicitConversions::testWithModifiedVisibility()
const AbstractMetaClass *classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
AbstractMetaFunctionList implicitConvs = classA->implicitConversions();
QCOMPARE(implicitConvs.count(), 1);
- QCOMPARE(implicitConvs.first()->arguments().first()->type()->typeEntry(), classB->typeEntry());
+ QCOMPARE(implicitConvs.constFirst()->arguments().constFirst()->type()->typeEntry(),
+ classB->typeEntry());
}
@@ -157,7 +159,7 @@ void TestImplicitConversions::testWithExternalConversionOperator()
convOp = func;
}
QVERIFY(convOp);
- QCOMPARE(implicitConvs.first(), convOp);
+ QCOMPARE(implicitConvs.constFirst(), convOp);
}
QTEST_APPLESS_MAIN(TestImplicitConversions)
diff --git a/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp b/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp
index 2d1692ee9..13cbaf2d8 100644
--- a/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp
@@ -53,7 +53,7 @@ void TestInsertTemplate::testInsertTemplateOnClassInjectCode()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
QCOMPARE(classA->typeEntry()->codeSnips().count(), 1);
- QString code = classA->typeEntry()->codeSnips().first().code();
+ QString code = classA->typeEntry()->codeSnips().constFirst().code();
QVERIFY(code.contains(QLatin1String("code template content")));
}
@@ -79,7 +79,7 @@ void TestInsertTemplate::testInsertTemplateOnModuleInjectCode()
QCOMPARE(module->name(), QLatin1String("Foo"));
QVERIFY(module);
QCOMPARE(module->codeSnips().count(), 1);
- QString code = module->codeSnips().first().code().trimmed();
+ QString code = module->codeSnips().constFirst().code().trimmed();
QVERIFY(code.contains(QLatin1String("code template content")));
}
diff --git a/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp b/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp
index debe25be6..77bc6b5c9 100644
--- a/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp
@@ -303,15 +303,15 @@ void TestModifyFunction::testGlobalFunctionModification()
FunctionModificationList mods = TypeDatabase::instance()->functionModifications(QLatin1String("function(A*)"));
QCOMPARE(mods.count(), 1);
- QVector<ArgumentModification> argMods = mods.first().argument_mods;
+ QVector<ArgumentModification> argMods = mods.constFirst().argument_mods;
QCOMPARE(argMods.count(), 1);
- ArgumentModification argMod = argMods.first();
+ ArgumentModification argMod = argMods.constFirst();
QCOMPARE(argMod.replacedDefaultExpression, QLatin1String("A()"));
- const AbstractMetaFunction* func = builder->globalFunctions().first();
+ const AbstractMetaFunction *func = builder->globalFunctions().constFirst();
QVERIFY(func);
QCOMPARE(func->arguments().count(), 1);
- const AbstractMetaArgument* arg = func->arguments().first();
+ const AbstractMetaArgument *arg = func->arguments().constFirst();
QCOMPARE(arg->type()->cppSignature(), QLatin1String("A *"));
QCOMPARE(arg->originalDefaultValueExpression(), QLatin1String("0"));
QCOMPARE(arg->defaultValueExpression(), QLatin1String("A()"));
diff --git a/sources/shiboken2/ApiExtractor/tests/testnestedtypes.cpp b/sources/shiboken2/ApiExtractor/tests/testnestedtypes.cpp
index e61418467..446c6f431 100644
--- a/sources/shiboken2/ApiExtractor/tests/testnestedtypes.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testnestedtypes.cpp
@@ -68,24 +68,24 @@ void TestNestedTypes::testNestedTypesModifications()
QVERIFY(ins);
QCOMPARE(ins->functions().count(), 1);
QCOMPARE(ins->typeEntry()->codeSnips().count(), 1);
- CodeSnip snip = ins->typeEntry()->codeSnips().first();
+ CodeSnip snip = ins->typeEntry()->codeSnips().constFirst();
QCOMPARE(snip.code().trimmed(), QLatin1String("custom_code1();"));
- AbstractMetaFunction* addedFunc = ins->functions().first();
+ AbstractMetaFunction *addedFunc = ins->functions().constFirst();
QVERIFY(addedFunc->isUserAdded());
QCOMPARE(addedFunc->visibility(), AbstractMetaFunction::Public);
QCOMPARE(addedFunc->functionType(), AbstractMetaFunction::NormalFunction);
QCOMPARE(addedFunc->type()->minimalSignature(), QLatin1String("OuterNamespace::InnerNamespace::SomeClass"));
QCOMPARE(addedFunc->modifications().size(), 1);
- QVERIFY(addedFunc->modifications().first().isCodeInjection());
- snip = addedFunc->modifications().first().snips.first();
+ QVERIFY(addedFunc->modifications().constFirst().isCodeInjection());
+ snip = addedFunc->modifications().constFirst().snips.constFirst();
QCOMPARE(snip.code().trimmed(), QLatin1String("custom_code2();"));
const AbstractMetaClass *sc = AbstractMetaClass::findClass(classes, QLatin1String("OuterNamespace::InnerNamespace::SomeClass"));
QVERIFY(ins);
QCOMPARE(sc->functions().count(), 2); // default constructor and removed method
- AbstractMetaFunction* removedFunc = sc->functions().last();
+ AbstractMetaFunction *removedFunc = sc->functions().constLast();
QVERIFY(removedFunc->isModifiedRemoved());
}
diff --git a/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp b/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp
index 4f0b0e10f..03129073a 100644
--- a/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testnumericaltypedef.cpp
@@ -49,9 +49,9 @@ void TestNumericalTypedef::testNumericalTypedef()
QVERIFY(!builder.isNull());
QCOMPARE(builder->globalFunctions().size(), 2);
- const AbstractMetaFunction* funcDouble = builder->globalFunctions().first();
+ const AbstractMetaFunction *funcDouble = builder->globalFunctions().constFirst();
QVERIFY(funcDouble);
- const AbstractMetaFunction* funcReal = builder->globalFunctions().last();
+ const AbstractMetaFunction *funcReal = builder->globalFunctions().constLast();
QVERIFY(funcReal);
if (funcDouble->name() == QLatin1String("funcReal"))
@@ -60,13 +60,13 @@ void TestNumericalTypedef::testNumericalTypedef()
QCOMPARE(funcDouble->minimalSignature(), QLatin1String("funcDouble(double)"));
QCOMPARE(funcReal->minimalSignature(), QLatin1String("funcReal(real)"));
- const AbstractMetaType* doubleType = funcDouble->arguments().first()->type();
+ const AbstractMetaType *doubleType = funcDouble->arguments().constFirst()->type();
QVERIFY(doubleType);
QCOMPARE(doubleType->cppSignature(), QLatin1String("double"));
QVERIFY(doubleType->isPrimitive());
QVERIFY(doubleType->typeEntry()->isCppPrimitive());
- const AbstractMetaType* realType = funcReal->arguments().first()->type();
+ const AbstractMetaType *realType = funcReal->arguments().constFirst()->type();
QVERIFY(realType);
QCOMPARE(realType->cppSignature(), QLatin1String("real"));
QVERIFY(realType->isPrimitive());
@@ -76,41 +76,41 @@ void TestNumericalTypedef::testNumericalTypedef()
void TestNumericalTypedef::testUnsignedNumericalTypedef()
{
const char* cppCode ="\
- typedef unsigned short ushort;\n\
+ typedef unsigned short custom_ushort;\n\
void funcUnsignedShort(unsigned short);\n\
- void funcUShort(ushort);\n";
+ void funcUShort(custom_ushort);\n";
const char* xmlCode = "\
<typesystem package='Foo'>\n\
<primitive-type name='short'/>\n\
<primitive-type name='unsigned short'/>\n\
- <primitive-type name='ushort'/>\n\
+ <primitive-type name='custom_ushort'/>\n\
<function signature='funcUnsignedShort(unsigned short)'/>\n\
- <function signature='funcUShort(ushort)'/>\n\
+ <function signature='funcUShort(custom_ushort)'/>\n\
</typesystem>\n";
QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false));
QVERIFY(!builder.isNull());
QCOMPARE(builder->globalFunctions().size(), 2);
- const AbstractMetaFunction* funcUnsignedShort = builder->globalFunctions().first();
+ const AbstractMetaFunction *funcUnsignedShort = builder->globalFunctions().constFirst();
QVERIFY(funcUnsignedShort);
- const AbstractMetaFunction* funcUShort = builder->globalFunctions().last();
+ const AbstractMetaFunction *funcUShort = builder->globalFunctions().constLast();
QVERIFY(funcUShort);
if (funcUnsignedShort->name() == QLatin1String("funcUShort"))
std::swap(funcUnsignedShort, funcUShort);
QCOMPARE(funcUnsignedShort->minimalSignature(), QLatin1String("funcUnsignedShort(unsigned short)"));
- QCOMPARE(funcUShort->minimalSignature(), QLatin1String("funcUShort(ushort)"));
+ QCOMPARE(funcUShort->minimalSignature(), QLatin1String("funcUShort(custom_ushort)"));
- const AbstractMetaType* unsignedShortType = funcUnsignedShort->arguments().first()->type();
+ const AbstractMetaType *unsignedShortType = funcUnsignedShort->arguments().constFirst()->type();
QVERIFY(unsignedShortType);
QCOMPARE(unsignedShortType->cppSignature(), QLatin1String("unsigned short"));
QVERIFY(unsignedShortType->isPrimitive());
QVERIFY(unsignedShortType->typeEntry()->isCppPrimitive());
- const AbstractMetaType* ushortType = funcUShort->arguments().first()->type();
+ const AbstractMetaType *ushortType = funcUShort->arguments().constFirst()->type();
QVERIFY(ushortType);
- QCOMPARE(ushortType->cppSignature(), QLatin1String("ushort"));
+ QCOMPARE(ushortType->cppSignature(), QLatin1String("custom_ushort"));
QVERIFY(ushortType->isPrimitive());
QVERIFY(ushortType->typeEntry()->isCppPrimitive());
}
diff --git a/sources/shiboken2/ApiExtractor/tests/testrefcounttag.cpp b/sources/shiboken2/ApiExtractor/tests/testrefcounttag.cpp
index 38099c455..9d1dcc1ae 100644
--- a/sources/shiboken2/ApiExtractor/tests/testrefcounttag.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testrefcounttag.cpp
@@ -56,7 +56,7 @@ void TestRefCountTag::testReferenceCountTag()
const AbstractMetaClass *classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
const AbstractMetaFunction* func = classB->findFunction(QLatin1String("keepObject"));
QVERIFY(func);
- ReferenceCount refCount = func->modifications().first().argument_mods.first().referenceCounts.first();
+ ReferenceCount refCount = func->modifications().constFirst().argument_mods.constFirst().referenceCounts.constFirst();
QCOMPARE(refCount.action, ReferenceCount::Add);
}
@@ -89,7 +89,7 @@ void TestRefCountTag::testWithApiVersion()
const AbstractMetaClass *classB = AbstractMetaClass::findClass(classes, QLatin1String("B"));
const AbstractMetaFunction* func = classB->findFunction(QLatin1String("keepObject"));
QVERIFY(func);
- ReferenceCount refCount = func->modifications().first().argument_mods.first().referenceCounts.first();
+ ReferenceCount refCount = func->modifications().constFirst().argument_mods.constFirst().referenceCounts.constFirst();
QCOMPARE(refCount.action, ReferenceCount::Add);
QCOMPARE(func->modifications().size(), 1);
diff --git a/sources/shiboken2/ApiExtractor/tests/testreferencetopointer.cpp b/sources/shiboken2/ApiExtractor/tests/testreferencetopointer.cpp
index c7b4abe9a..228bfaecd 100644
--- a/sources/shiboken2/ApiExtractor/tests/testreferencetopointer.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testreferencetopointer.cpp
@@ -51,7 +51,7 @@ void TestReferenceToPointer::testReferenceToPointerArgument()
QVERIFY(classB);
const AbstractMetaFunction* func = classB->findFunction(QLatin1String("dummy"));
QVERIFY(func);
- QCOMPARE(func->arguments().first()->type()->minimalSignature(), QLatin1String("A*&"));
+ QCOMPARE(func->arguments().constFirst()->type()->minimalSignature(), QLatin1String("A*&"));
}
QTEST_APPLESS_MAIN(TestReferenceToPointer)
diff --git a/sources/shiboken2/ApiExtractor/tests/testremovefield.cpp b/sources/shiboken2/ApiExtractor/tests/testremovefield.cpp
index b586fd711..dd9b735a4 100644
--- a/sources/shiboken2/ApiExtractor/tests/testremovefield.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testremovefield.cpp
@@ -52,7 +52,7 @@ void TestRemoveField::testRemoveField()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
QCOMPARE(classA->fields().size(), 1);
- const AbstractMetaField* fieldA = classA->fields().first();
+ const AbstractMetaField *fieldA = classA->fields().constFirst();
QVERIFY(fieldA);
QCOMPARE(fieldA->name(), QLatin1String("fieldA"));
}
diff --git a/sources/shiboken2/ApiExtractor/tests/testremoveimplconv.cpp b/sources/shiboken2/ApiExtractor/tests/testremoveimplconv.cpp
index 96090d1cc..20170089a 100644
--- a/sources/shiboken2/ApiExtractor/tests/testremoveimplconv.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testremoveimplconv.cpp
@@ -63,7 +63,8 @@ void TestRemoveImplConv::testRemoveImplConv()
QVERIFY(classC);
AbstractMetaFunctionList implConv = classC->implicitConversions();
QCOMPARE(implConv.count(), 1);
- QCOMPARE(implConv.first()->arguments().first()->type()->typeEntry(), classB->typeEntry());
+ QCOMPARE(implConv.constFirst()->arguments().constFirst()->type()->typeEntry(),
+ classB->typeEntry());
}
QTEST_APPLESS_MAIN(TestRemoveImplConv)
diff --git a/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp b/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp
index ec3ddb8b2..f6c70a651 100644
--- a/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp
+++ b/sources/shiboken2/ApiExtractor/tests/testtemplates.cpp
@@ -115,15 +115,15 @@ namespace Namespace {
QVERIFY(!classB->baseClass());
QVERIFY(classB->baseClassName().isEmpty());
const AbstractMetaFunction* func = classB->findFunction(QLatin1String("foo"));
- AbstractMetaType* argType = func->arguments().first()->type();
+ AbstractMetaType* argType = func->arguments().constFirst()->type();
QCOMPARE(argType->instantiations().count(), 1);
QCOMPARE(argType->typeEntry()->qualifiedCppName(), QLatin1String("QList"));
- const AbstractMetaType* instance1 = argType->instantiations().first();
+ const AbstractMetaType* instance1 = argType->instantiations().constFirst();
QCOMPARE(instance1->instantiations().count(), 1);
QCOMPARE(instance1->typeEntry()->qualifiedCppName(), QLatin1String("Namespace::A"));
- const AbstractMetaType* instance2 = instance1->instantiations().first();
+ const AbstractMetaType* instance2 = instance1->instantiations().constFirst();
QCOMPARE(instance2->instantiations().count(), 0);
QCOMPARE(instance2->typeEntry()->qualifiedCppName(), QLatin1String("Namespace::E1"));
}
@@ -147,9 +147,10 @@ void func(List<int> arg) {}
AbstractMetaFunctionList globalFuncs = builder->globalFunctions();
QCOMPARE(globalFuncs.count(), 1);
- AbstractMetaFunction* func = globalFuncs.first();
+ AbstractMetaFunction *func = globalFuncs.constFirst();
QCOMPARE(func->minimalSignature(), QLatin1String("func(List<int>)"));
- QCOMPARE(func->arguments().first()->type()->cppSignature(), QLatin1String("List<int >"));
+ QCOMPARE(func->arguments().constFirst()->type()->cppSignature(),
+ QLatin1String("List<int >"));
}
void TestTemplates::testTemplatePointerAsArgument()
@@ -171,9 +172,10 @@ void func(List<int>* arg) {}
AbstractMetaFunctionList globalFuncs = builder->globalFunctions();
QCOMPARE(globalFuncs.count(), 1);
- AbstractMetaFunction* func = globalFuncs.first();
+ AbstractMetaFunction* func = globalFuncs.constFirst();
QCOMPARE(func->minimalSignature(), QLatin1String("func(List<int>*)"));
- QCOMPARE(func->arguments().first()->type()->cppSignature(), QLatin1String("List<int > *"));
+ QCOMPARE(func->arguments().constFirst()->type()->cppSignature(),
+ QLatin1String("List<int > *"));
}
void TestTemplates::testTemplateReferenceAsArgument()
@@ -195,9 +197,10 @@ void func(List<int>& arg) {}
AbstractMetaFunctionList globalFuncs = builder->globalFunctions();
QCOMPARE(globalFuncs.count(), 1);
- AbstractMetaFunction* func = globalFuncs.first();
+ AbstractMetaFunction* func = globalFuncs.constFirst();
QCOMPARE(func->minimalSignature(), QLatin1String("func(List<int>&)"));
- QCOMPARE(func->arguments().first()->type()->cppSignature(), QLatin1String("List<int > &"));
+ QCOMPARE(func->arguments().constFirst()->type()->cppSignature(),
+ QLatin1String("List<int > &"));
}
void TestTemplates::testTemplateParameterFixup()
@@ -223,7 +226,7 @@ struct List {
const AbstractMetaClassList templates = builder->templates();
QCOMPARE(templates.count(), 1);
- const AbstractMetaClass *list = templates.first();
+ const AbstractMetaClass *list = templates.constFirst();
// Verify that the parameter of "void append(List l)" gets fixed to "List<T >"
const AbstractMetaFunction *append = list->findFunction(QStringLiteral("append"));
QVERIFY(append);
@@ -269,7 +272,7 @@ struct FooBars : public ListContainer<FooBar> {};
const AbstractMetaClass* foobars = AbstractMetaClass::findClass(classes, QLatin1String("FooBars"));
QCOMPARE(foobars->functions().count(), 4);
- const AbstractMetaClass* lc = templates.first();
+ const AbstractMetaClass *lc = templates.constFirst();
QCOMPARE(lc->functions().count(), 2);
}
@@ -391,7 +394,7 @@ typedef BaseTemplateClass<TypeOne> TypeOneClass;
QVERIFY(one->hasTemplateBaseClassInstantiations());
AbstractMetaTypeList instantiations = one->templateBaseClassInstantiations();
QCOMPARE(instantiations.count(), 1);
- const AbstractMetaType* inst = instantiations.first();
+ const AbstractMetaType *inst = instantiations.constFirst();
QVERIFY(inst);
QVERIFY(!inst->isEnum());
QVERIFY(!inst->typeEntry()->isEnum());
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py
index c64abf9fb..bb8ce48bf 100644
--- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py
+++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/mapping.py
@@ -499,6 +499,16 @@ def init_PySide2_QtCore():
return locals()
+def init_PySide2_QtConcurrent():
+ type_map.update({
+ "PySide2.QtCore.QFuture[QString]":
+ PySide2.QtConcurrent.QFutureQString,
+ "PySide2.QtCore.QFuture[void]":
+ PySide2.QtConcurrent.QFutureVoid,
+ })
+ return locals()
+
+
def init_PySide2_QtGui():
from PySide2.QtGui import QPageLayout, QPageSize # 5.12 macOS
type_map.update({