summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorThiago A. Correa <thiago.correa@gmail.com>2012-10-04 13:11:23 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-05 03:16:37 +0200
commitb742dbdc3fe85062cfe133de9db9e81703203ac0 (patch)
tree118a5ca8bcf86cd167d0c1583399d9024f01b61f /src/sql
parentbdd3521f832f1ef1b596cf022e75219a590d08bc (diff)
Fix QSqlQuery::value to use proper index check
Change the validation of index parameter to use -1 constant instead of QSql::BeforeFirstRow which is unrelated to field index Change-Id: I43b42bc7ce717bcd9ddc987d2e716f1672c00775 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/kernel/qsqlquery.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 8cba7623be..eff211cc37 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -399,7 +399,7 @@ bool QSqlQuery::exec(const QString& query)
QVariant QSqlQuery::value(int index) const
{
- if (isActive() && isValid() && (index > QSql::BeforeFirstRow))
+ if (isActive() && isValid() && (index > -1))
return d->sqlResult->data(index);
qWarning("QSqlQuery::value: not positioned on a valid record");
return QVariant();