diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-23 17:14:06 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-23 20:01:55 +0200 |
commit | 2b1698862d93c4256ea4deae720d00269c448d5e (patch) | |
tree | c2bf3a2e5f75f334573d397abd9cc5a7ef382271 /examples/charts/modeldata/customtablemodel.cpp | |
parent | cd4593b108f7b308fb21f8b6451ba0a8da1cb169 (diff) |
Use QList instead of QVector in qtcharts examples
Task-number: QTBUG-84469
Change-Id: I724c4d793294d890e26ff7d39021bbdc9438e978
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'examples/charts/modeldata/customtablemodel.cpp')
-rw-r--r-- | examples/charts/modeldata/customtablemodel.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/charts/modeldata/customtablemodel.cpp b/examples/charts/modeldata/customtablemodel.cpp index 8ef3c2a9..96256232 100644 --- a/examples/charts/modeldata/customtablemodel.cpp +++ b/examples/charts/modeldata/customtablemodel.cpp @@ -28,7 +28,7 @@ ****************************************************************************/ #include "customtablemodel.h" -#include <QtCore/QVector> +#include <QtCore/QList> #include <QtCore/QRandomGenerator> #include <QtCore/QRect> #include <QtGui/QColor> @@ -41,14 +41,14 @@ CustomTableModel::CustomTableModel(QObject *parent) : // m_data for (int i = 0; i < m_rowCount; i++) { - QVector<qreal>* dataVec = new QVector<qreal>(m_columnCount); - for (int k = 0; k < dataVec->size(); k++) { + QList<qreal> *dataList = new QList<qreal>(m_columnCount); + for (int k = 0; k < dataList->size(); k++) { if (k % 2 == 0) - dataVec->replace(k, i * 50 + QRandomGenerator::global()->bounded(20)); + dataList->replace(k, i * 50 + QRandomGenerator::global()->bounded(20)); else - dataVec->replace(k, QRandomGenerator::global()->bounded(100)); + dataList->replace(k, QRandomGenerator::global()->bounded(100)); } - m_data.append(dataVec); + m_data.append(dataList); } } |