QSqlTableModel::setRecord(): emit dataChanged() consistently
authorMark Brand <mabrand@mabrand.nl>
Mon, 6 Feb 2012 15:05:53 +0000 (16:05 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 8 Feb 2012 13:43:18 +0000 (14:43 +0100)
commit7b726900ecdd1d4d5e9b8f7c34f00dd27524b1c6
tree325d5730eb0cf39520174b357e2b997ceaffcdc6
parent5953304bc5f50eca77f78fd0623479de6bebacbe
QSqlTableModel::setRecord(): emit dataChanged() consistently

Previously, if any fields in the supplied record could not be matched
with a column in the target table, dataChanged() was supressed for all
columns for OnManualSubmit. This is not good because it prevents other
views from noticing the fields that *do* change.

It's simplest and probably more efficient just to emit
dataChanged() once for the whole row. Fewer signals need to be
processed and in typical cases much or all of the row is likely to
be changed anyway.

Change-Id: Ib56bf9a18e51b9cb85771acefcb2bf26e295a54e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
src/sql/models/qsqltablemodel.cpp
tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp