at first, you have only one column (according to your query text)
second, you set position only on first record (query.next())
and then try to read data from non-existed columns (you have only one column!)
so, try this code
Qt Code:
  1. ....
  2. while (query.next()) {
  3. QString data = query.value(0).toString();//first column == nome_prod
  4. ....
  5. }
  6. ....
To copy to clipboard, switch view to plain text mode 

read for detailes QSqlQuery::next