Hi,

I'm trying to figure out how to edit the content of a qtableview.

I have a QTableView which displays sqlite data from a QSqlQuery.

Qt Code:
  1. QSqlQuery query("SELECT * FROM IdentityLog", db);
  2. while (query.next()) {
  3.  
  4. int event = query.value(3).toInt();
  5.  
  6. switch ( event )
  7. {
  8. case 1:
  9. //set value;
  10. break;
  11. case 2:
  12. //set value
  13. break;
  14. default:
  15. break;
  16. }
  17. }
  18.  
  19. model->setQuery( query );
  20. }
To copy to clipboard, switch view to plain text mode 

Where and how do I set the value. I do not want to edit the database, only the table. I've been reading through the classes for QTableView and for QSqlQuery but I can't figure out how to modify the value at a certain index.

Any help is greatly appreciated. Thanks in advance!

Emorgen