From f5e1da12f0e7bdeee4db74acc52dfabeb12a4e31 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 6 Feb 2012 17:02:32 +0100 Subject: QSqlTableModel::removeRows(): don't emit extra beforeDelete Qt 5 seems like a welcome opportunity to stop emitting this spurious beforeDelete signal. Change-Id: Ib8628343ca9b8fdd85c154a206c7e2bf2c4c9dc1 Reviewed-by: Yunqiao Yin --- src/sql/models/qsqltablemodel.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/sql/models') diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 46d493b726..4094052f1a 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -990,8 +990,6 @@ bool QSqlTableModel::removeRows(int row, int count, const QModelIndex &parent) if (parent.isValid() || row < 0 || count <= 0) return false; - int initialRowCount = rowCount(); - int i; for (i = 0; i < count && row + i < rowCount(); ++i) { int idx = row + i; @@ -1012,12 +1010,6 @@ bool QSqlTableModel::removeRows(int row, int count, const QModelIndex &parent) if (d->strategy != OnManualSubmit && i > 0) submit(); - // historical bug: emit beforeDelete for 1st row beyond end - if (d->strategy != OnManualSubmit) { - if (row + count > initialRowCount) - emit beforeDelete(qMax(initialRowCount, row)); - } - if (i < count) return false; -- cgit v1.2.3