Все ,нашел я .
QSqlRecord rec = a_query.record();
int number = 0,
age = 0;
QString address = "";
while (a_query.next()) {
number = a_query.value(rec.indexOf("number")).toInt();
age = a_query.value(rec.indexOf("age")).toInt();
address = a_query.value(rec.indexOf("address")).toString();
qDebug() << "number is " << number
<< ". age is " << age
<< ". address" << address;
}
Но у меня подобный код не работает
QSqlQuery a_query;
QSqlRecord rec = a_query.record();
QString addressExe;
QString addressIcon;
while(a_query.next()) {
addressExe = a_query.value(rec.indexOf("addressExe")).toString();
addressIcon = a_query.value(rec.indexOf("addressIcon")).toString();
}
qDebug() << addressExe << addressIcon;
}