Quote Originally Posted by anda_skoa View Post
You will have to reimplement the setData() function and store the edited data in your model subclass.
In data() you then need to check if you have local data for the respective cell and return it instead.

From you description I take that you have only one such column, so a simple mapping from inf (row) to QVariant (data) should do the trick for the local storage.

Cheers,
_
Thanks for the tip.. However, being a beginner, I can't wrap my head around it..
tried this and I know something is missing as setData is not calling Data()

Qt Code:
  1. QByteRef EditableSQLModel::data(const QModelIndex &index, int role)
  2. {
  3. QVariant value = QSqlQueryModel::data(index, role);
  4. if (value!="")
  5. return value.toByteArray();
  6. else
  7. return ArgsLength;
  8.  
  9. }
  10. bool EditableSQLModel::setData(const QModelIndex &index, const QVariant &value, int /* role */)
  11. {
  12. if (index.column() !=1)
  13. return false;
  14. ArgsLength= value;
  15.  
  16.  
  17.  
  18. return 1;
  19. }
To copy to clipboard, switch view to plain text mode