I have a QSqlTableModel and a QTableView.
Trying to make just one column not editable.
Found several examples in previous posts, but nothing is making sense to me as how to accomplish this in my code.

The signal/slot for when a cell is clicked is working ok.

Here is what I have so far:

Qt Code:
  1. void MainWindow::checkEditable(QModelIndex index) {
  2. qDebug() << "view has been clicked!"; // good so far
  3. int col = index.column();
  4. int row = index.row();
  5. qDebug() << "clicked column is " << col; // got the column ok
  6. if (col != 0) { // it should be ok to edit
  7. // now what???
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 

Am I on the wrong track or is this simple to finish?