title: QSqlQuery not positioned on a valid record
body: <p>I'm trying select a field of my date base, the code is:</p>
  
  <pre><code>if (db.db().isOpen())
  {
    qDebug() &lt;&lt; "OK";
    QSqlQuery query("SELECT state FROM jobs WHERE jobId = '553'", db.db());
    qDebug() &lt;&lt; query.value(0).toString();
  }
  else
    qDebug() &lt;&lt; "No ok"; 
  </code></pre>
  
  <p>The query is correct because when I do  <code>qDebug() &lt;&lt; query.size;</code>, it  returns <code>1</code>.</p>
  
  <p>but with <code>qDebug() &lt;&lt; query.value(0).toString();</code>, it returns:</p>
  
  <pre><code>OK 
  QSqlQuery::value: not positioned on a valid record
  ""
  </code></pre>
  
  <p>How can I fix it?</p>