summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-22 10:12:38 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-23 14:01:11 +0200
commit29c99bddbf48f97b054a34354f55b36a3f84a62c (patch)
treeca0116c45cc3cb04e13a953316f468012d3dc2d2 /examples/widgets/itemviews/editabletreemodel/treemodel.cpp
parentd7efb2a419a88c8f512b98194c8f7bc81dbe942b (diff)
Use QList instead of QVector in examples
Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'examples/widgets/itemviews/editabletreemodel/treemodel.cpp')
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
index 9678e45be7..1161a8b5d2 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
@@ -57,7 +57,7 @@
TreeModel::TreeModel(const QStringList &headers, const QString &data, QObject *parent)
: QAbstractItemModel(parent)
{
- QVector<QVariant> rootData;
+ QList<QVariant> rootData;
for (const QString &header : headers)
rootData << header;
@@ -248,8 +248,8 @@ bool TreeModel::setHeaderData(int section, Qt::Orientation orientation,
void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
{
- QVector<TreeItem*> parents;
- QVector<int> indentations;
+ QList<TreeItem *> parents;
+ QList<int> indentations;
parents << parent;
indentations << 0;
@@ -269,7 +269,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
// Read the column data from the rest of the line.
const QStringList columnStrings =
lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
- QVector<QVariant> columnData;
+ QList<QVariant> columnData;
columnData.reserve(columnStrings.size());
for (const QString &columnString : columnStrings)
columnData << columnString;