diff options
author | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2016-04-01 18:43:17 +0200 |
---|---|---|
committer | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2016-04-06 18:00:28 +0000 |
commit | f4b831dc965fe9a544d7989473265916676aaa51 (patch) | |
tree | 3f04a54ac106fd60d2d5fd81174ee495315dba21 /src/qml/types/qqmllistmodel.cpp | |
parent | f3479766ba1feff6df9e3eba347cc369f7a6c5e7 (diff) |
Replace custom loop with qDeleteAll
Change-Id: I21a1442913217e4707b110ede68b8bf4e7d60a03
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/types/qqmllistmodel.cpp')
-rw-r--r-- | src/qml/types/qqmllistmodel.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 0c31361075..60175ef310 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -169,9 +169,7 @@ ListLayout::ListLayout(const ListLayout *other) : currentBlock(0), currentBlockO ListLayout::~ListLayout() { - for (int i=0 ; i < roles.count() ; ++i) { - delete roles[i]; - } + qDeleteAll(roles); } void ListLayout::sync(ListLayout *src, ListLayout *target) @@ -1659,8 +1657,7 @@ QQmlListModel::QQmlListModel(QQmlListModel *orig, QQmlListModelWorkerAgent *agen QQmlListModel::~QQmlListModel() { - for (int i=0 ; i < m_modelObjects.count() ; ++i) - delete m_modelObjects[i]; + qDeleteAll(m_modelObjects); if (m_primary) { m_listModel->destroy(); |