QSqlTableModel: do not suppress dataChanged() on inserted record
authorMark Brand <mabrand@mabrand.nl>
Mon, 6 Feb 2012 13:04:26 +0000 (14:04 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 8 Feb 2012 13:43:18 +0000 (14:43 +0100)
commitf3138fa080b1c6ce7ab28c4572c3cf647b3485c1
tree04da0c5a42ad643c47feb65d14447c28438d0f90
parent471cd624e632812f5b4147ba3a221562dbe9d300
QSqlTableModel: do not suppress dataChanged() on inserted record

Affects setData() and setRecord().

Previously dataChanged() was suppressed when editing an inserted
record, except for OnManualSubmit. The motivation was probably to
allow setData() to be used while handling primeInsert().

Suppressing dataChanged() is not a good idea since views other than
the one which made the change will not know of the change.

It is a terrible idea to call setData() or setRecord() while
handling primeInsert(), so this is now expressly forbidden.
setData() and setRecord() now do nothing and return false if called
while rows are being inserted.

Change-Id: I96738c09a6268704c5626d95b72bfb46378e3242
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
dist/changes-5.0.0
src/sql/models/qsqltablemodel.cpp
src/sql/models/qsqltablemodel_p.h