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>bb10
parent
bdd3521f83
commit
b742dbdc3f
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue