diff options
author | Derick Hawcroft <derick.hawcroft@nokia.com> | 2009-11-05 00:17:16 (GMT) |
---|---|---|
committer | Derick Hawcroft <derick.hawcroft@nokia.com> | 2009-11-05 00:17:16 (GMT) |
commit | 829f617ab2d4f240950ce88e9ce97421a2939a74 (patch) | |
tree | bd52ed98767ffcb3ce4864cc676c20ad4c3856e1 /src | |
parent | 5b21746da4899a7d6dd78cf949e0a918c127fd49 (diff) | |
download | Qt-829f617ab2d4f240950ce88e9ce97421a2939a74.zip Qt-829f617ab2d4f240950ce88e9ce97421a2939a74.tar.gz Qt-829f617ab2d4f240950ce88e9ce97421a2939a74.tar.bz2 |
Check success of query.
For example a bogus use of setFilter() might cause a query to fail.
Check for this.
Reviewed-by: Bill King
Diffstat (limited to 'src')
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index a91dc9f..98f22c8 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -406,7 +406,7 @@ bool QSqlTableModel::select() QSqlQuery qu(query, d->db); setQuery(qu); - if (!qu.isActive()) { + if (!qu.isActive() || lastError().isValid()) { // something went wrong - revert to non-select state d->initRecordAndPrimaryIndex(); return false; |