aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-03-29 11:16:20 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-06 08:36:03 +0000
commit69d28aa054cb43cbc0f68b2cc18fbedcbca1e0d5 (patch)
treeee214b0659548204d92d101e31f4fa5112b39737
parent6a4865f5bba1d15bc3e91f720486c9e23cafc8c5 (diff)
AbstractMetaLang/Typesystem: Replace QList by QVector
QList will be deprecated in Qt. Change-Id: I82c997366736c1f976b142cb142da39976736f49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--ApiExtractor/abstractmetabuilder.cpp20
-rw-r--r--ApiExtractor/abstractmetabuilder_p.h2
-rw-r--r--ApiExtractor/abstractmetalang.cpp10
-rw-r--r--ApiExtractor/abstractmetalang.h14
-rw-r--r--ApiExtractor/abstractmetalang_typedefs.h14
-rw-r--r--ApiExtractor/include.h4
-rw-r--r--ApiExtractor/tests/testabstractmetaclass.cpp10
-rw-r--r--ApiExtractor/tests/testaddfunction.cpp2
-rw-r--r--ApiExtractor/tests/testextrainclude.cpp4
-rw-r--r--ApiExtractor/tests/testmodifyfunction.cpp2
-rw-r--r--ApiExtractor/typeparser.h3
-rw-r--r--ApiExtractor/typesystem.cpp2
-rw-r--r--ApiExtractor/typesystem.h25
-rw-r--r--ApiExtractor/typesystem_typedefs.h11
-rw-r--r--generator/generator.cpp2
-rw-r--r--generator/shiboken2/cppgenerator.cpp4
-rw-r--r--generator/shiboken2/shibokengenerator.cpp2
-rw-r--r--generator/shiboken2/shibokengenerator.h6
18 files changed, 72 insertions, 65 deletions
diff --git a/ApiExtractor/abstractmetabuilder.cpp b/ApiExtractor/abstractmetabuilder.cpp
index d1004a2..31c78ce 100644
--- a/ApiExtractor/abstractmetabuilder.cpp
+++ b/ApiExtractor/abstractmetabuilder.cpp
@@ -1277,7 +1277,7 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::traverseClass(const FileModelItem
}
TemplateParameterList template_parameters = classItem->templateParameters();
- QList<TypeEntry *> template_args;
+ QVector<TypeEntry *> template_args;
template_args.clear();
for (int i = 0; i < template_parameters.size(); ++i) {
const TemplateParameterModelItem &param = template_parameters.at(i);
@@ -1551,7 +1551,7 @@ static bool _compareAbstractMetaFunctions(const AbstractMetaFunction* func, cons
// "QList(const QList &)" to "QList(const QList<T> &)".
static bool _fixFunctionModelItemTypes(FunctionModelItem& function, const AbstractMetaClass* metaClass)
{
- const QList<TypeEntry *> &templateTypes = metaClass->templateArguments();
+ const QVector<TypeEntry *> &templateTypes = metaClass->templateArguments();
if (templateTypes.isEmpty())
return false;
@@ -1921,7 +1921,7 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu
metaFunction->setType(translateType(addedFunc.version(), addedFunc.returnType()));
- QList<AddedFunction::TypeInfo> args = addedFunc.arguments();
+ QVector<AddedFunction::TypeInfo> args = addedFunc.arguments();
AbstractMetaArgumentList metaArguments;
for (int i = 0; i < args.count(); ++i) {
@@ -2222,7 +2222,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(FunctionModel
} else {
FunctionModificationList mods = TypeDatabase::instance()->functionModifications(metaFunction->minimalSignature());
if (!mods.isEmpty()) {
- QList<ArgumentModification> argMods = mods.first().argument_mods;
+ QVector<ArgumentModification> argMods = mods.first().argument_mods;
if (!argMods.isEmpty())
replacedExpression = argMods.first().replacedDefaultExpression;
}
@@ -2518,7 +2518,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const TypeInfo &_typ
// 8. No? Check if the current class is a template and this type is one
// of the parameters.
if (!type && m_currentClass) {
- const QList<TypeEntry *> &template_args = m_currentClass->templateArguments();
+ const QVector<TypeEntry *> &template_args = m_currentClass->templateArguments();
for (TypeEntry *te : template_args) {
if (te->name() == qualifiedName)
type = te;
@@ -2847,7 +2847,7 @@ bool AbstractMetaBuilderPrivate::ancestorHasPrivateCopyConstructor(const Abstrac
return false;
}
-AbstractMetaType* AbstractMetaBuilderPrivate::inheritTemplateType(const QList<AbstractMetaType *> &templateTypes,
+AbstractMetaType* AbstractMetaBuilderPrivate::inheritTemplateType(const QVector<AbstractMetaType *> &templateTypes,
const AbstractMetaType *metaType,
bool *ok)
{
@@ -2899,8 +2899,8 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(AbstractMetaClass *subclass,
const AbstractMetaClass *templateClass,
const TypeParser::Info &info)
{
- QList<TypeParser::Info> targs = info.template_instantiations;
- QList<AbstractMetaType*> templateTypes;
+ QVector<TypeParser::Info> targs = info.template_instantiations;
+ QVector<AbstractMetaType *> templateTypes;
if (subclass->isTypeDef()) {
subclass->setHasCloneOperator(templateClass->hasCloneOperator());
@@ -3124,11 +3124,11 @@ void AbstractMetaBuilderPrivate::setupClonable(AbstractMetaClass *cls)
QQueue<AbstractMetaClass*> baseClasses;
if (cls->baseClass())
baseClasses.enqueue(cls->baseClass());
- baseClasses << cls->interfaces();
+ baseClasses << cls->interfaces().toList();
while (!baseClasses.isEmpty()) {
AbstractMetaClass* currentClass = baseClasses.dequeue();
- baseClasses << currentClass->interfaces();
+ baseClasses << currentClass->interfaces().toList();
if (currentClass->baseClass())
baseClasses.enqueue(currentClass->baseClass());
diff --git a/ApiExtractor/abstractmetabuilder_p.h b/ApiExtractor/abstractmetabuilder_p.h
index 4dcdb60..96a6fdb 100644
--- a/ApiExtractor/abstractmetabuilder_p.h
+++ b/ApiExtractor/abstractmetabuilder_p.h
@@ -140,7 +140,7 @@ public:
bool inheritTemplate(AbstractMetaClass *subclass,
const AbstractMetaClass *templateClass,
const TypeParser::Info &info);
- AbstractMetaType *inheritTemplateType(const QList<AbstractMetaType *> &templateTypes,
+ AbstractMetaType *inheritTemplateType(const QVector<AbstractMetaType *> &templateTypes,
const AbstractMetaType *metaType,
bool *ok = Q_NULLPTR);
diff --git a/ApiExtractor/abstractmetalang.cpp b/ApiExtractor/abstractmetalang.cpp
index 0a7dc0f..a309088 100644
--- a/ApiExtractor/abstractmetalang.cpp
+++ b/ApiExtractor/abstractmetalang.cpp
@@ -280,7 +280,7 @@ void AbstractMetaType::decideUsagePattern()
bool AbstractMetaType::hasTemplateChildren() const
{
QStack<AbstractMetaType *> children;
- children << m_children.toVector();
+ children << m_children;
// Recursively iterate over the children / descendants of the type, to check if any of them
// corresponds to a template argument type.
@@ -288,7 +288,7 @@ bool AbstractMetaType::hasTemplateChildren() const
AbstractMetaType *child = children.pop();
if (child->typeEntry()->isTemplateArgument())
return true;
- children << child->m_children.toVector();
+ children << child->m_children;
}
return false;
@@ -389,7 +389,7 @@ bool AbstractMetaFunction::needsCallThrough() const
bool AbstractMetaFunction::needsSuppressUncheckedWarning() const
{
for (int i = -1; i <= arguments().size(); ++i) {
- const QList<ReferenceCount> &referenceCounts = this->referenceCounts(implementingClass(), i);
+ const QVector<ReferenceCount> &referenceCounts = this->referenceCounts(implementingClass(), i);
for (const ReferenceCount &referenceCount : referenceCounts) {
if (referenceCount.action != ReferenceCount::Set)
return true;
@@ -600,9 +600,9 @@ int AbstractMetaFunction::actualMinimumArgumentCount() const
}
// Returns reference counts for argument at idx, or all arguments if idx == -2
-QList<ReferenceCount> AbstractMetaFunction::referenceCounts(const AbstractMetaClass *cls, int idx) const
+QVector<ReferenceCount> AbstractMetaFunction::referenceCounts(const AbstractMetaClass *cls, int idx) const
{
- QList<ReferenceCount> returned;
+ QVector<ReferenceCount> returned;
const FunctionModificationList &mods = this->modifications(cls);
for (const FunctionModification &mod : mods) {
diff --git a/ApiExtractor/abstractmetalang.h b/ApiExtractor/abstractmetalang.h
index 0d03d2f..082e55c 100644
--- a/ApiExtractor/abstractmetalang.h
+++ b/ApiExtractor/abstractmetalang.h
@@ -1122,7 +1122,7 @@ public:
QString replacedDefaultExpression(const AbstractMetaClass *cls, int idx) const;
bool removedDefaultExpression(const AbstractMetaClass *cls, int idx) const;
QString conversionRule(TypeSystem::Language language, int idx) const;
- QList<ReferenceCount> referenceCounts(const AbstractMetaClass *cls, int idx = -2) const;
+ QVector<ReferenceCount> referenceCounts(const AbstractMetaClass *cls, int idx = -2) const;
ArgumentOwner argumentOwner(const AbstractMetaClass *cls, int idx) const;
bool nullPointersDisabled(const AbstractMetaClass *cls = 0, int argument_idx = 0) const;
@@ -1294,7 +1294,7 @@ private:
};
-class AbstractMetaEnumValueList : public QList<AbstractMetaEnumValue *>
+class AbstractMetaEnumValueList : public QVector<AbstractMetaEnumValue *>
{
public:
AbstractMetaEnumValue *find(const QString &name) const;
@@ -1698,12 +1698,12 @@ public:
bool hasProtectedMembers() const;
- QList<TypeEntry *> templateArguments() const
+ QVector<TypeEntry *> templateArguments() const
{
return m_templateArgs;
}
- void setTemplateArguments(const QList<TypeEntry *> &args)
+ void setTemplateArguments(const QVector<TypeEntry *> &args)
{
m_templateArgs = args;
}
@@ -1772,7 +1772,7 @@ public:
m_propertySpecs << spec;
}
- QList<QPropertySpec *> propertySpecs() const
+ QVector<QPropertySpec *> propertySpecs() const
{
return m_propertySpecs;
}
@@ -1874,13 +1874,13 @@ private:
AbstractMetaEnumList m_enums;
AbstractMetaClassList m_interfaces;
AbstractMetaClass *m_extractedInterface;
- QList<QPropertySpec *> m_propertySpecs;
+ QVector<QPropertySpec *> m_propertySpecs;
AbstractMetaClassList m_innerClasses;
AbstractMetaFunctionList m_externalConversionOperators;
QStringList m_baseClassNames;
- QList<TypeEntry *> m_templateArgs;
+ QVector<TypeEntry *> m_templateArgs;
ComplexTypeEntry *m_typeEntry;
// FunctionModelItem m_qDebugStreamFunction;
diff --git a/ApiExtractor/abstractmetalang_typedefs.h b/ApiExtractor/abstractmetalang_typedefs.h
index dd6573b..1081902 100644
--- a/ApiExtractor/abstractmetalang_typedefs.h
+++ b/ApiExtractor/abstractmetalang_typedefs.h
@@ -29,7 +29,7 @@
#ifndef ABSTRACTMETALANG_TYPEDEFS_H
#define ABSTRACTMETALANG_TYPEDEFS_H
-#include <QtCore/QList>
+#include <QtCore/QVector>
class AbstractMetaClass;
class AbstractMetaField;
@@ -39,11 +39,11 @@ class AbstractMetaEnumValueList;
class AbstractMetaFunction;
class AbstractMetaType;
-typedef QList<AbstractMetaArgument *> AbstractMetaArgumentList;
-typedef QList<AbstractMetaClass *> AbstractMetaClassList;
-typedef QList<AbstractMetaEnum *> AbstractMetaEnumList;
-typedef QList<AbstractMetaField *> AbstractMetaFieldList;
-typedef QList<AbstractMetaFunction *> AbstractMetaFunctionList;
-typedef QList<AbstractMetaType *> AbstractMetaTypeList;
+typedef QVector<AbstractMetaArgument *> AbstractMetaArgumentList;
+typedef QVector<AbstractMetaClass *> AbstractMetaClassList;
+typedef QVector<AbstractMetaEnum *> AbstractMetaEnumList;
+typedef QVector<AbstractMetaField *> AbstractMetaFieldList;
+typedef QVector<AbstractMetaFunction *> AbstractMetaFunctionList;
+typedef QVector<AbstractMetaType *> AbstractMetaTypeList;
#endif // ABSTRACTMETALANG_TYPEDEFS_H
diff --git a/ApiExtractor/include.h b/ApiExtractor/include.h
index e4ff5b3..dc4965e 100644
--- a/ApiExtractor/include.h
+++ b/ApiExtractor/include.h
@@ -30,7 +30,7 @@
#define INCLUDE_H
#include <QString>
-#include <QList>
+#include <QVector>
QT_BEGIN_NAMESPACE
class QTextStream;
@@ -87,6 +87,6 @@ QTextStream& operator<<(QTextStream& out, const Include& include);
QDebug operator<<(QDebug d, const Include &i);
#endif
-typedef QList<Include> IncludeList;
+typedef QVector<Include> IncludeList;
#endif
diff --git a/ApiExtractor/tests/testabstractmetaclass.cpp b/ApiExtractor/tests/testabstractmetaclass.cpp
index 0285221..423b8d9 100644
--- a/ApiExtractor/tests/testabstractmetaclass.cpp
+++ b/ApiExtractor/tests/testabstractmetaclass.cpp
@@ -57,7 +57,7 @@ void TestAbstractMetaClass::testClassNameUnderNamespace()
AbstractMetaClassList classes = builder->classes();
QCOMPARE(classes.count(), 2); // 1 namespace + 1 class
if (classes.first()->name() != QLatin1String("ClassName"))
- classes.swap(0, 1);
+ qSwap(classes[0], classes[1]);
QCOMPARE(classes[0]->name(), QLatin1String("ClassName"));
QCOMPARE(classes[0]->qualifiedCppName(), QLatin1String("Namespace::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()"))
- ctors.swap(0, 1);
+ qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 0);
QCOMPARE(ctors[0]->minimalSignature(), QLatin1String("ClassName()"));
@@ -361,7 +361,7 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
if (ctors.first()->minimalSignature() != QLatin1String("A()"))
- ctors.swap(0, 1);
+ qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 0);
QCOMPARE(ctors[0]->minimalSignature(), QLatin1String("A()"));
@@ -395,7 +395,7 @@ void TestAbstractMetaClass::testClassDefaultConstructors()
ctors = classF->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
if (ctors.first()->minimalSignature() != QLatin1String("F(int,int)"))
- ctors.swap(0, 1);
+ qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 2);
QCOMPARE(ctors[0]->minimalSignature(), QLatin1String("F(int,int)"));
@@ -428,7 +428,7 @@ void TestAbstractMetaClass::testClassInheritedDefaultConstructors()
AbstractMetaFunctionList ctors = classA->queryFunctions(AbstractMetaClass::Constructors);
QCOMPARE(ctors.size(), 2);
if (ctors.first()->minimalSignature() != QLatin1String("A()"))
- ctors.swap(0, 1);
+ qSwap(ctors[0], ctors[1]);
QCOMPARE(ctors[0]->arguments().size(), 0);
QCOMPARE(ctors[0]->minimalSignature(), QLatin1String("A()"));
diff --git a/ApiExtractor/tests/testaddfunction.cpp b/ApiExtractor/tests/testaddfunction.cpp
index 119d536..bcc5238 100644
--- a/ApiExtractor/tests/testaddfunction.cpp
+++ b/ApiExtractor/tests/testaddfunction.cpp
@@ -49,7 +49,7 @@ void TestAddFunction::testParsingFuncNameAndConstness()
const char sig2[] = " _fu__nc_ ( type1, const type2, const Abc<int& , C<char*> * > * *, const type3* const ) const ";
AddedFunction f2(QLatin1String(sig2), QLatin1String("const Abc<int& , C<char*> * > * *"), 0);
QCOMPARE(f2.name(), QLatin1String("_fu__nc_"));
- QList< AddedFunction::TypeInfo > args = f2.arguments();
+ QVector< AddedFunction::TypeInfo > args = f2.arguments();
QCOMPARE(args.count(), 4);
retval = f2.returnType();
QCOMPARE(retval.name, QLatin1String("Abc<int& , C<char*> * >"));
diff --git a/ApiExtractor/tests/testextrainclude.cpp b/ApiExtractor/tests/testextrainclude.cpp
index 9415837..97f0d56 100644
--- a/ApiExtractor/tests/testextrainclude.cpp
+++ b/ApiExtractor/tests/testextrainclude.cpp
@@ -50,7 +50,7 @@ void TestExtraInclude::testClassExtraInclude()
const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A"));
QVERIFY(classA);
- QList<Include> includes = classA->typeEntry()->extraIncludes();
+ QVector<Include> includes = classA->typeEntry()->extraIncludes();
QCOMPARE(includes.count(), 1);
QCOMPARE(includes.first().name(), QLatin1String("header.h"));
}
@@ -76,7 +76,7 @@ void TestExtraInclude::testGlobalExtraIncludes()
TypeEntry* module = td->findType(QLatin1String("Foo"));
QVERIFY(module);
- QList<Include> includes = module->extraIncludes();
+ QVector<Include> includes = module->extraIncludes();
QCOMPARE(includes.count(), 2);
QCOMPARE(includes.first().name(), QLatin1String("header1.h"));
QCOMPARE(includes.last().name(), QLatin1String("header2.h"));
diff --git a/ApiExtractor/tests/testmodifyfunction.cpp b/ApiExtractor/tests/testmodifyfunction.cpp
index 0e6bdc2..3d4ef9c 100644
--- a/ApiExtractor/tests/testmodifyfunction.cpp
+++ b/ApiExtractor/tests/testmodifyfunction.cpp
@@ -232,7 +232,7 @@ void TestModifyFunction::testGlobalFunctionModification()
FunctionModificationList mods = TypeDatabase::instance()->functionModifications(QLatin1String("function(A*)"));
QCOMPARE(mods.count(), 1);
- QList<ArgumentModification> argMods = mods.first().argument_mods;
+ QVector<ArgumentModification> argMods = mods.first().argument_mods;
QCOMPARE(argMods.count(), 1);
ArgumentModification argMod = argMods.first();
QCOMPARE(argMod.replacedDefaultExpression, QLatin1String("A()"));
diff --git a/ApiExtractor/typeparser.h b/ApiExtractor/typeparser.h
index 9ccd099..f42c42a 100644
--- a/ApiExtractor/typeparser.h
+++ b/ApiExtractor/typeparser.h
@@ -34,6 +34,7 @@
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QStringList>
+#include <QtCore/QVector>
class TypeParser
{
@@ -43,7 +44,7 @@ public:
Info() : referenceType(NoReference), is_constant(false), is_busted(false), indirections(0) { }
QStringList qualified_name;
QStringList arrays;
- QList<Info> template_instantiations;
+ QVector<Info> template_instantiations;
ReferenceType referenceType;
uint is_constant : 1;
uint is_busted : 1;
diff --git a/ApiExtractor/typesystem.cpp b/ApiExtractor/typesystem.cpp
index a5b98b0..33bd790 100644
--- a/ApiExtractor/typesystem.cpp
+++ b/ApiExtractor/typesystem.cpp
@@ -49,7 +49,7 @@ static inline QString nameAttribute() { return QStringLiteral("name"); }
static inline QString sinceAttribute() { return QStringLiteral("since"); }
static inline QString flagsAttribute() { return QStringLiteral("flags"); }
-static QList<CustomConversion*> customConversionsForReview = QList<CustomConversion*>();
+static QVector<CustomConversion *> customConversionsForReview;
Handler::Handler(TypeDatabase* database, bool generate)
: m_database(database), m_generate(generate ? TypeEntry::GenerateAll : TypeEntry::GenerateForSubclass)
diff --git a/ApiExtractor/typesystem.h b/ApiExtractor/typesystem.h
index 80b3f1c..480ca95 100644
--- a/ApiExtractor/typesystem.h
+++ b/ApiExtractor/typesystem.h
@@ -38,6 +38,7 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QMap>
+#include <QtCore/QVector>
//Used to identify the conversion rule to avoid break API
#define TARGET_CONVERSION_RULE_FLAG "0"
@@ -103,6 +104,7 @@ private:
TemplateInstance *m_instance;
public:
+ CodeSnipFragment() : m_instance(0) {}
CodeSnipFragment(const QString &code)
: m_code(code),
m_instance(0) {}
@@ -126,7 +128,7 @@ public:
codeList.append(CodeSnipFragment(ti));
}
- QList<CodeSnipFragment> codeList;
+ QVector<CodeSnipFragment> codeList;
};
class CustomFunction : public CodeSnipAbstract
@@ -194,6 +196,7 @@ private:
class CodeSnip : public CodeSnipAbstract
{
public:
+ CodeSnip() : language(TypeSystem::TargetLangCode), version(0) {}
CodeSnip(double vr) : language(TypeSystem::TargetLangCode), version(vr) { }
CodeSnip(double vr, TypeSystem::Language lang) : language(lang), version(vr) { }
@@ -205,6 +208,8 @@ public:
struct ArgumentModification
{
+ ArgumentModification() : removedDefaultExpression(false), removed(false),
+ noNullPointers(false), index(-1), version(0) {}
ArgumentModification(int idx, double vr)
: removedDefaultExpression(false), removed(false),
noNullPointers(false), index(idx), version(vr) {}
@@ -219,7 +224,7 @@ struct ArgumentModification
int index;
// Reference count flags for this argument
- QList<ReferenceCount> referenceCounts;
+ QVector<ReferenceCount> referenceCounts;
// The text given for the new type of the argument
QString modified_type;
@@ -344,6 +349,7 @@ struct Modification
struct FunctionModification: public Modification
{
+ FunctionModification() : m_thread(false), m_allowThread(false), m_version(0) {}
FunctionModification(double vr) : m_thread(false), m_allowThread(false), m_version(vr) {}
bool isCodeInjection() const
@@ -381,11 +387,9 @@ struct FunctionModification: public Modification
QString association;
CodeSnipList snips;
- QList<ArgumentModification> argument_mods;
+ QVector<ArgumentModification> argument_mods;
private:
- FunctionModification() {}
-
bool m_thread;
bool m_allowThread;
double m_version;
@@ -440,6 +444,7 @@ struct AddedFunction
/// Creates a new AddedFunction with a signature and a return type.
AddedFunction(QString signature, QString returnType, double vr);
+ AddedFunction() : m_access(Protected), m_isConst(false), m_isStatic(false), m_version(0) {}
/// Returns the function name.
QString name() const
@@ -466,7 +471,7 @@ struct AddedFunction
}
/// Returns a list of argument type infos.
- QList<TypeInfo> arguments() const
+ QVector<TypeInfo> arguments() const
{
return m_arguments;
}
@@ -496,7 +501,7 @@ struct AddedFunction
private:
QString m_name;
Access m_access;
- QList<TypeInfo> m_arguments;
+ QVector<TypeInfo> m_arguments;
TypeInfo m_returnType;
bool m_isConst;
bool m_isStatic;
@@ -525,6 +530,7 @@ class ObjectTypeEntry;
class DocModification
{
public:
+ DocModification() : format(TypeSystem::NativeCode), m_mode(TypeSystem::DocModificationXPathReplace), m_version(0) {}
DocModification(const QString& xpath, const QString& signature, double vr)
: format(TypeSystem::NativeCode), m_mode(TypeSystem::DocModificationXPathReplace),
m_xpath(xpath), m_signature(signature), m_version(vr) {}
@@ -1119,6 +1125,7 @@ private:
struct EnumValueRedirection
{
+ EnumValueRedirection() {}
EnumValueRedirection(const QString &rej, const QString &us)
: rejected(rej),
used(us)
@@ -1272,7 +1279,7 @@ private:
QString m_upperBound;
QStringList m_rejectedEnums;
- QList<EnumValueRedirection> m_enumRedirections;
+ QVector<EnumValueRedirection> m_enumRedirections;
FlagsTypeEntry *m_flags;
@@ -1932,7 +1939,7 @@ public:
bool replaceOriginalTargetToNativeConversions() const;
void setReplaceOriginalTargetToNativeConversions(bool replaceOriginalTargetToNativeConversions);
- typedef QList<TargetToNativeConversion*> TargetToNativeConversions;
+ typedef QVector<TargetToNativeConversion*> TargetToNativeConversions;
bool hasTargetToNativeConversions() const;
TargetToNativeConversions& targetToNativeConversions();
const TargetToNativeConversions& targetToNativeConversions() const;
diff --git a/ApiExtractor/typesystem_typedefs.h b/ApiExtractor/typesystem_typedefs.h
index 04b6696..4849ee3 100644
--- a/ApiExtractor/typesystem_typedefs.h
+++ b/ApiExtractor/typesystem_typedefs.h
@@ -31,6 +31,7 @@
#include <QtCore/QHash>
#include <QtCore/QList>
+#include <QtCore/QVector>
class CodeSnip;
class ContainerTypeEntry;
@@ -47,12 +48,12 @@ typedef QHash<QString, QList<TypeEntry *> > TypeEntryHash;
typedef QHash<QString, TypeEntry *> SingleTypeEntryHash;
typedef QHash<QString, TemplateEntry *> TemplateEntryHash;
-typedef QList<AddedFunction> AddedFunctionList;
-typedef QList<CodeSnip> CodeSnipList;
+typedef QVector<AddedFunction> AddedFunctionList;
+typedef QVector<CodeSnip> CodeSnipList;
typedef QList<const ContainerTypeEntry *> ContainerTypeEntryList;
-typedef QList<DocModification> DocModificationList;
-typedef QList<FieldModification> FieldModificationList;
-typedef QList<FunctionModification> FunctionModificationList;
+typedef QVector<DocModification> DocModificationList;
+typedef QVector<FieldModification> FieldModificationList;
+typedef QVector<FunctionModification> FunctionModificationList;
typedef QList<const PrimitiveTypeEntry *> PrimitiveTypeEntryList;
#endif // TYPESYSTEM_TYPEDEFS_H
diff --git a/generator/generator.cpp b/generator/generator.cpp
index c252ef7..61c1ede 100644
--- a/generator/generator.cpp
+++ b/generator/generator.cpp
@@ -668,7 +668,7 @@ QString Generator::minimalConstructor(const AbstractMetaClass* metaClass) const
QString qualifiedCppName = metaClass->typeEntry()->qualifiedCppName();
QStringList templateTypes;
- const QList<TypeEntry *> &templateArguments = metaClass->templateArguments();
+ const QVector<TypeEntry *> &templateArguments = metaClass->templateArguments();
for (TypeEntry *templateType : templateArguments)
templateTypes << templateType->qualifiedCppName();
diff --git a/generator/shiboken2/cppgenerator.cpp b/generator/shiboken2/cppgenerator.cpp
index af20bc2..76b80ba 100644
--- a/generator/shiboken2/cppgenerator.cpp
+++ b/generator/shiboken2/cppgenerator.cpp
@@ -275,7 +275,7 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
//Extra includes
s << endl << "// Extra includes" << endl;
- QList<Include> includes = metaClass->typeEntry()->extraIncludes();
+ QVector<Include> includes = metaClass->typeEntry()->extraIncludes();
for (AbstractMetaEnum *cppEnum : qAsConst(classEnums))
includes.append(cppEnum->typeEntry()->extraIncludes());
qSort(includes.begin(), includes.end());
@@ -5208,7 +5208,7 @@ bool CppGenerator::finishGeneration()
//Extra includes
s << endl << "// Extra includes" << endl;
- QList<Include> extraIncludes;
+ QVector<Include> extraIncludes;
if (moduleEntry)
extraIncludes = moduleEntry->extraIncludes();
for (AbstractMetaEnum *cppEnum : qAsConst(globalEnums))
diff --git a/generator/shiboken2/shibokengenerator.cpp b/generator/shiboken2/shibokengenerator.cpp
index 64cbbeb..54f4990 100644
--- a/generator/shiboken2/shibokengenerator.cpp
+++ b/generator/shiboken2/shibokengenerator.cpp
@@ -1327,8 +1327,6 @@ QString ShibokenGenerator::argumentString(const AbstractMetaFunction *func,
arg += argument->name();
}
- QList<ReferenceCount> referenceCounts;
- referenceCounts = func->referenceCounts(func->implementingClass(), argument->argumentIndex() + 1);
if ((options & Generator::SkipDefaultValues) != Generator::SkipDefaultValues &&
!argument->originalDefaultValueExpression().isEmpty())
{
diff --git a/generator/shiboken2/shibokengenerator.h b/generator/shiboken2/shibokengenerator.h
index a2c33d7..228df23 100644
--- a/generator/shiboken2/shibokengenerator.h
+++ b/generator/shiboken2/shibokengenerator.h
@@ -142,20 +142,20 @@ public:
/// Write user's custom code snippets at class or module level.
void writeCodeSnips(QTextStream& s,
- const QList<CodeSnip>& codeSnips,
+ const QVector<CodeSnip> & codeSnips,
TypeSystem::CodeSnipPosition position,
TypeSystem::Language language,
const AbstractMetaClass* context = 0);
/// Write user's custom code snippets at function level.
void writeCodeSnips(QTextStream& s,
- const QList<CodeSnip>& codeSnips,
+ const QVector<CodeSnip> & codeSnips,
TypeSystem::CodeSnipPosition position,
TypeSystem::Language language,
const AbstractMetaFunction* func,
const AbstractMetaArgument* lastArg = 0);
/// Returns a string with the user's custom code snippets that comply with \p position and \p language.
- QString getCodeSnippets(const QList<CodeSnip>& codeSnips, TypeSystem::CodeSnipPosition position, TypeSystem::Language language);
+ QString getCodeSnippets(const QVector<CodeSnip> & codeSnips, TypeSystem::CodeSnipPosition position, TypeSystem::Language language);
/// Replaces variables for the user's custom code at global or class level.
void processCodeSnip(QString& code, const AbstractMetaClass* context = 0);