summaryrefslogtreecommitdiffstats
path: root/src/sql/models
diff options
context:
space:
mode:
authorMark Brand <mabrand@mabrand.nl>2013-01-06 14:17:09 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-10 13:26:33 (GMT)
commit771b34fb0c62f8c1e982dbcf256bc90ddaba64b7 (patch)
treec8bc0146ac5b462918af8c798551616fa1b0f1a9 /src/sql/models
parent2ec2dbd89072f651be737192337b7f968fa54e42 (diff)
downloadQt-771b34fb0c62f8c1e982dbcf256bc90ddaba64b7.zip
Qt-771b34fb0c62f8c1e982dbcf256bc90ddaba64b7.tar.gz
Qt-771b34fb0c62f8c1e982dbcf256bc90ddaba64b7.tar.bz2
QSqlTableModel: fix dataChanged() index for removed edited row
Last column index is columnCount() - 1 This change is not applicable to Qt 5. Task-number: QTBUG-28961 Change-Id: Ib962ab5f737bf9c216423ee9d0632757d33f3bd2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/sql/models')
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index c8b4770..1860435 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -909,7 +909,7 @@ void QSqlTableModel::revertRow(int row)
d->editBuffer.clear();
int oldIndex = d->editIndex;
d->editIndex = -1;
- emit dataChanged(createIndex(oldIndex, 0), createIndex(oldIndex, columnCount()));
+ emit dataChanged(createIndex(oldIndex, 0), createIndex(oldIndex, columnCount() - 1));
} else if (d->insertIndex == row) {
d->revertInsertedRow();
}