From f73e3f0546e8dce2180d3f95994e273ebc1f685b Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Wed, 10 Apr 2013 20:44:00 +0200 Subject: [PATCH] SqliteTableModel: Fix really stupid bug in insertRows() and removeRows() --- src/sqlitetablemodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index e0cacb5c..faf54fe7 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -172,6 +172,8 @@ bool SqliteTableModel::insertRows(int row, int count, const QModelIndex& parent) m_data[row].replace(0, QByteArray::number(m_db->addRecord(m_sTable))); } + m_rowCount += count; + endInsertRows(); return true; } @@ -186,6 +188,8 @@ bool SqliteTableModel::removeRows(int row, int count, const QModelIndex& parent) m_data.removeAt(row + i); } + m_rowCount -= count; + endRemoveRows(); return true; }