Hi,
I have a QSqlTableModel. I use Blanchette's method to insert a new row:
int row = myModel->rowCount();
myModel->insertRow(row);
myTableView->setCurrentIndex(index);
myTableView->edit(index);
int row = myModel->rowCount();
myModel->insertRow(row);
QModelIndex index = myModel->index(row, 1);
myTableView->setCurrentIndex(index);
myTableView->edit(index);
To copy to clipboard, switch view to plain text mode
I would like to fill one of the columns of myModel (which is hidden in the View) with a value (which depends on a selection on another table). Is that possible?
Thanks in advance.
I reply to myself, as I found a way:
myModel->setData(myModel->index(row,1), value);
myModel->setData(myModel->index(row,1), value);
To copy to clipboard, switch view to plain text mode
Bookmarks