summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2014-10-21 11:53:15 +0200
committerCaroline Chao <caroline.chao@theqtcompany.com>2014-10-21 13:35:46 +0200
commitc0f5fd60919e51e45103b7aa381acff5c99818eb (patch)
tree968d2e1854346866055ec9d420bbf348b9bdc9ec
parent0572e873f11dfaa69db2bd2723a9058e99522859 (diff)
Fix Models::reset() function
Call begin/end ResetModel instead of RemoveRows. Change-Id: Ica960b84343c9f76781cfd9eea237365ef4151da Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/model.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/model.cpp b/src/model.cpp
index b2b9fe0..c8bfd2c 100644
--- a/src/model.cpp
+++ b/src/model.cpp
@@ -362,9 +362,7 @@ bool Model::parse(const QJsonObject &object)
void Model::reset()
{
- if (m_data.count() > 0) {
- beginRemoveRows(QModelIndex(), 0, m_data.count() - 1);
- m_data.clear();
- endRemoveRows();
- }
+ beginResetModel();
+ m_data.clear();
+ endResetModel();
}