|author||Mark Brand <firstname.lastname@example.org>||2012-02-06 14:04:26 +0100|
|committer||Qt by Nokia <email@example.com>||2012-02-08 14:43:18 +0100|
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 <firstname.lastname@example.org>
Diffstat (limited to 'dist')
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
@@ -328,6 +328,20 @@ QTestLib
* [QTBUG-20615] Autotests can now log test output to multiple destinations
and log formats simultaneously.
+* 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.