I have a QSqlQuery as follows:
Qt Code:
  1. QSqlQuery q("SELECT video.codVideo, video.codSupporto, video.title, SUM(availableNol) AS available
  2. FROM video INNER JOIN dvd ON (video.codSupporto=dvd.codSupporto) AND (video.codVideo=dvd.codVideo)
  3. GROUP BY video.codVideo, video.codSupporto, title");
To copy to clipboard, switch view to plain text mode 

Then I created a queryModel and a QSqlRecord called record..everything OK the table is correctly printed and I can retrieve almost all fields except the one called available which is a calculated one..I tried:
Qt Code:
  1. int disp = record.value(3).toInt();
  2. qDebug()<<"available: "<<disp;
To copy to clipboard, switch view to plain text mode 
but qDebug always returns 0 even if it is correctly printed in the table view.
Is it a problem retrieving calculated values in a query?