Hello all!

I've started developing my programs using MVC. I've:

Qt Code:
  1. model = new QSqlQueryModel;
  2. model->setQuery("SELECT ID_t, ID_podmiot FROM m_transporty LIMIT 0 , 30");
  3. if(model->lastError().isValid())
  4. qDebug() << model->lastError();
  5.  
  6. ui->tableView->setModel(model);
To copy to clipboard, switch view to plain text mode 

Works beautifully!

Now - how do I now edit a data (eg in the "line" table)? How to call a cell editing (I click on it and nothing happens), and later as the values ​​(for example, when you click "save") write to the database?
I know I can read all the data in the model, but probably not the point of MVC. Since I changed one record (row) is what I overexpose the entire model?


Can I implement editing only in the model?
How do I add or delete a record not only the model but also from the database?

Thanks!