If you're using QAbstractTableModel
, you can reimpliment the flags()
member function to return a read-only flag.
Have a look at the Qt::ItemFlags to see which ones you need and then leave off what you don't. At the very least, you should not be returning Qt::ItemIsEditable