Hi to all,
I've compiled the following and "same" code:

Qt Code:
  1. void frmCategorie_AME::inserisciCampi()
  2. {
  3. QString querySQL;
  4. querySQL = QString("INSERT INTO %1 VALUES (NULL,:primo,:secondo,1,0)")
  5. .arg(listaNomiPerTabella["nomeTabella"].toString());
  6.  
  7. QSqlQuery queryInserimento;
  8. queryInserimento.prepare(querySQL);
  9. queryInserimento.bindValue(":primo", ui.lnePrimo->text());
  10. queryInserimento.bindValue(":secondo",
  11. ui.cboSecondo->itemData(ui.cboSecondo->currentIndex()));
  12. if (queryInserimento.exec())
  13. {
  14. qDebug() << "INSERT OK!";
  15. qDebug() << queryInserimento.lastInsertId.toInt();
  16. }
  17. else
  18. {
  19. QMessageBox::critical(this, tr("Attenzione!"),
  20. tr("Il database ha riportato un errore: %1")
  21. .arg(queryInserimento.lastError().text()));
  22. }
  23. queryInserimento.finish();
  24. }
To copy to clipboard, switch view to plain text mode 

unbeliveble but the latest version(2009.02) give me back the following error:

Qt Code:
  1. src\frmCategorie_AME.cpp: In member function `void frmCategorie_AME::inserisciCampi()':
  2. src\frmCategorie_AME.cpp:15: error: insufficient contextual information to determine type
  3. make[1]: *** [debug/frmCategorie_AME.o] Error 1
To copy to clipboard, switch view to plain text mode 

qDebug() << queryInserimento.lastInsertId.toInt(); == insufficient contextual information to determine type

HELP!!!