You can use QSqlQuery::value(int index) to get the value of field index in the current record.

Qt Code:
  1. query.exec("SELECT ....");
  2. query.next();
  3. qDebug() << query.value(0).toInt() << query.value(1).toString(); // just an example
To copy to clipboard, switch view to plain text mode