summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-22 12:47:00 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-25 07:54:21 +0200
commit64c3ca091026de433780ba05f006294968f78526 (patch)
tree24210006235fc52211c6d4881bf324e9a4c4a486
parent33c24b9b9d0c6ae1899cec2e01bad9df01ca05f6 (diff)
Use QList instead of QVector in sql
Task-number: QTBUG-84469 Change-Id: I942aec7d949331a52d7f12fa2725d8d9707f605f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/sql/kernel/qsqlcachedresult_p.h2
-rw-r--r--src/sql/kernel/qsqlindex.h2
-rw-r--r--src/sql/kernel/qsqlrecord.cpp2
-rw-r--r--src/sql/kernel/qsqlresult.cpp10
-rw-r--r--src/sql/kernel/qsqlresult.h2
-rw-r--r--src/sql/kernel/qsqlresult_p.h6
-rw-r--r--src/sql/models/qsqlquerymodel_p.h2
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp2
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
-rw-r--r--src/sql/models/qsqltablemodel_p.h2
10 files changed, 16 insertions, 16 deletions
diff --git a/src/sql/kernel/qsqlcachedresult_p.h b/src/sql/kernel/qsqlcachedresult_p.h
index 0b9dfd3e9a..fbebd10284 100644
--- a/src/sql/kernel/qsqlcachedresult_p.h
+++ b/src/sql/kernel/qsqlcachedresult_p.h
@@ -67,7 +67,7 @@ class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult
Q_DECLARE_PRIVATE(QSqlCachedResult)
public:
- typedef QVector<QVariant> ValueCache;
+ typedef QList<QVariant> ValueCache;
protected:
QSqlCachedResult(QSqlCachedResultPrivate &d);
diff --git a/src/sql/kernel/qsqlindex.h b/src/sql/kernel/qsqlindex.h
index 6373b77031..b704cef685 100644
--- a/src/sql/kernel/qsqlindex.h
+++ b/src/sql/kernel/qsqlindex.h
@@ -70,7 +70,7 @@ private:
QString createField(int i, const QString& prefix, bool verbose) const;
QString cursor;
QString nm;
- QVector<bool> sorts;
+ QList<bool> sorts;
};
QT_END_NAMESPACE
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index 1c3e03fecf..0afeafe416 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -57,7 +57,7 @@ public:
inline bool contains(int index) { return index >= 0 && index < fields.count(); }
QString createField(int index, const QString &prefix) const;
- QVector<QSqlField> fields;
+ QList<QSqlField> fields;
QAtomicInt ref;
};
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index ecff0a7f2d..067afd9448 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -675,7 +675,7 @@ void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType param
{
Q_D(QSqlResult);
d->binds = PositionalBinding;
- QVector<int> &indexes = d->indexes[d->fieldSerial(index)];
+ QList<int> &indexes = d->indexes[d->fieldSerial(index)];
if (!indexes.contains(index))
indexes.append(index);
if (d->values.count() <= index)
@@ -702,7 +702,7 @@ void QSqlResult::bindValue(const QString& placeholder, const QVariant& val,
d->binds = NamedBinding;
// if the index has already been set when doing emulated named
// bindings - don't reset it
- const QVector<int> indexes = d->indexes.value(placeholder);
+ const QList<int> indexes = d->indexes.value(placeholder);
for (int idx : indexes) {
if (d->values.count() <= idx)
d->values.resize(idx + 1);
@@ -749,7 +749,7 @@ QVariant QSqlResult::boundValue(int index) const
QVariant QSqlResult::boundValue(const QString& placeholder) const
{
Q_D(const QSqlResult);
- const QVector<int> indexes = d->indexes.value(placeholder);
+ const QList<int> indexes = d->indexes.value(placeholder);
return d->values.value(indexes.value(0,-1));
}
@@ -793,7 +793,7 @@ int QSqlResult::boundValueCount() const
\sa boundValueCount()
*/
-QVector<QVariant>& QSqlResult::boundValues() const
+QList<QVariant> &QSqlResult::boundValues() const
{
Q_D(const QSqlResult);
return const_cast<QSqlResultPrivate *>(d)->values;
@@ -943,7 +943,7 @@ bool QSqlResult::execBatch(bool arrayBind)
Q_UNUSED(arrayBind);
Q_D(QSqlResult);
- QVector<QVariant> values = d->values;
+ QList<QVariant> values = d->values;
if (values.count() == 0)
return false;
for (int i = 0; i < values.at(0).toList().count(); ++i) {
diff --git a/src/sql/kernel/qsqlresult.h b/src/sql/kernel/qsqlresult.h
index a7fdae834a..862022c889 100644
--- a/src/sql/kernel/qsqlresult.h
+++ b/src/sql/kernel/qsqlresult.h
@@ -105,7 +105,7 @@ protected:
QSql::ParamType bindValueType(const QString& placeholder) const;
QSql::ParamType bindValueType(int pos) const;
int boundValueCount() const;
- QVector<QVariant>& boundValues() const;
+ QList<QVariant> &boundValues() const;
QString executedQuery() const;
QString boundValueName(int pos) const;
void clear();
diff --git a/src/sql/kernel/qsqlresult_p.h b/src/sql/kernel/qsqlresult_p.h
index 3b9697046d..672f3ac59b 100644
--- a/src/sql/kernel/qsqlresult_p.h
+++ b/src/sql/kernel/qsqlresult_p.h
@@ -119,11 +119,11 @@ public:
QString executedQuery;
QHash<int, QSql::ParamType> types;
- QVector<QVariant> values;
- using IndexMap = QHash<QString, QVector<int> >;
+ QList<QVariant> values;
+ using IndexMap = QHash<QString, QList<int>>;
IndexMap indexes;
- using QHolderVector = QVector<QHolder>;
+ using QHolderVector = QList<QHolder>;
QHolderVector holders;
QSqlResult::BindingSyntax binds = QSqlResult::PositionalBinding;
diff --git a/src/sql/models/qsqlquerymodel_p.h b/src/sql/models/qsqlquerymodel_p.h
index 64e9aeb3db..abacd64cde 100644
--- a/src/sql/models/qsqlquerymodel_p.h
+++ b/src/sql/models/qsqlquerymodel_p.h
@@ -80,7 +80,7 @@ public:
QModelIndex bottom;
QSqlRecord rec;
uint atEnd : 1;
- QVector<QHash<int, QVariant> > headers;
+ QList<QHash<int, QVariant>> headers;
QVarLengthArray<int, 56> colOffsets; // used to calculate indexInQuery of columns
int nestedResetLevel;
};
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index 4f5f00bf96..bdd82990d9 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -275,7 +275,7 @@ public:
QString fullyQualifiedFieldName(const QString &tableName, const QString &fieldName) const;
int nameToIndex(const QString &name) const override;
- mutable QVector<QRelation> relations;
+ mutable QList<QRelation> relations;
QSqlRecord baseRec; // the record without relations
void clearChanges();
void clearCache() override;
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 30a27bada8..cb5026eb79 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -63,7 +63,7 @@ QSqlTableModelPrivate::~QSqlTableModelPrivate()
/*! \internal
Populates our record with values.
*/
-QSqlRecord QSqlTableModelPrivate::record(const QVector<QVariant> &values) const
+QSqlRecord QSqlTableModelPrivate::record(const QList<QVariant> &values) const
{
QSqlRecord r = rec;
for (int i = 0; i < r.count() && i < values.count(); ++i)
diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h
index 9ac34e7259..d585f71548 100644
--- a/src/sql/models/qsqltablemodel_p.h
+++ b/src/sql/models/qsqltablemodel_p.h
@@ -75,7 +75,7 @@ public:
void clear();
virtual void clearCache();
- QSqlRecord record(const QVector<QVariant> &values) const;
+ QSqlRecord record(const QList<QVariant> &values) const;
bool exec(const QString &stmt, bool prepStatement,
const QSqlRecord &rec, const QSqlRecord &whereValues);