[QtSql][QSqlTableModel] fix failure to refresh in selectRow()

Caused by missing braces, leaving the break outside the scope of the if clause.

Task-number: QTBUG-38509
Change-Id: I6b0a7f34512a3a9b0fbd790116f81f54f4a91cf0
Reviewed-by: Tobias Koenig <tobias.koenig.qnx@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
bb10
Mark Brand 2014-04-25 17:55:04 +02:00 committed by The Qt Project
parent 1d372eddbe
commit 373d858812
1 changed files with 2 additions and 1 deletions

View File

@ -448,9 +448,10 @@ bool QSqlTableModel::selectRow(int row)
// Look for changed values. Primary key fields are customarily first
// and probably change less often than other fields, so start at the end.
for (int f = curValues.count() - 1; f >= 0; --f) {
if (curValues.value(f) != newValues.value(f))
if (curValues.value(f) != newValues.value(f)) {
needsAddingToCache = true;
break;
}
}
}
}