From 888fed8065f708baeb6efa5f280c2f1aec3dee78 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Tue, 21 Feb 2012 09:22:26 +0100 Subject: QSqlTableModel: use selectRow() for field and row edit strategies Calling select refreshes the query data but disrupts view navigation. For OnFieldChange and OnRecordChange it makes sense to only select the row in question. This does not disturb view navigation. Assume disruption of view navigation is not a problem for OnManualSubmit because the user or application decides when submitAll is called. Task-number: QTBUG-2875 Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4 Reviewed-by: Yunqiao Yin --- dist/changes-5.0.0 | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dist') diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index dd0a0693ed..33a8869397 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -406,6 +406,14 @@ ignore the rest of the range. QSqlTableModel::indexInQuery() as example of how to implement in a subclass. +* QSqlTableModel edit strategies OnFieldChange/OnRowChange QTBUG-2875 +Previously, after changes were submitted in these edit strategies, select() +was called which removed and inserted all rows. This ruined navigation +in QTableView. Now, with these edit strategies, there is no implicit select() +done after committing. This includes deleted rows which remain in +the model as blank rows until the application calls select(). Instead, +selectRow() is called to refresh only the affected row. + **************************************************************************** * Database Drivers * **************************************************************************** -- cgit v1.2.3