diff options
author | Mark Brand <mabrand@mabrand.nl> | 2012-02-06 14:04:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-08 14:43:18 +0100 |
commit | f3138fa080b1c6ce7ab28c4572c3cf647b3485c1 (patch) | |
tree | 04da0c5a42ad643c47feb65d14447c28438d0f90 /dist/changes-5.0.0 | |
parent | 471cd624e632812f5b4147ba3a221562dbe9d300 (diff) |
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>
Diffstat (limited to 'dist/changes-5.0.0')
-rw-r--r-- | dist/changes-5.0.0 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 5317137059..c62d8b1163 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -328,6 +328,20 @@ QTestLib * [QTBUG-20615] Autotests can now log test output to multiple destinations and log formats simultaneously. +QtSql +----- +QSqlTableModel/QSqlRelationalTableModel + +* The dataChanged() signal is now emitted for changes made to an inserted +record that has not yet been committed. Previously, dataChanged() was +suppressed in this case for OnRowChange and OnFieldChange. This was probably +an attempt to avoid trouble if setData() was called while handling +primeInsert(). By emitting dataChanged(), we ensure that all views are aware +of the change. + +* While handling primeInsert() signal, the record must be manipulated using +the provided reference. Do not attempt to manipulate the records using the +model methods setData() or setRecord(). * removeRows() no longer emits extra beforeDelete signal for out of range row. |