newbiesquare
newbiesquare

Reputation: 11

How do I use a QTableView with a database?

I'm using a QTableView with an hiden invoice_id column to manage invoices row,

I would like to know if there is a way to change the invoice_id column value, for each row, before committing.

Upvotes: 0

Views: 263

Answers (1)

newbiesquare
newbiesquare

Reputation: 11

The solution is to use setdata(),here is a little example:

model->setData(model->index(row, 1), QVariant(id));

Upvotes: 1

Related Questions