I've subclassed QAbstractTableModel and overrode the flags() method so that some of the table cells are editable. The problem is that when I start editing, the existing cell value is erased. I would like to initially have the existing cell value selected. How can I do this?
The solution is to handle Qt::EditRole when overriding data(). I was previously only handling Qt::DisplayRole.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With