I changed my code and I remove the sql query exec I tried to modify the data with the setData but unfortunately nothing happened


Qt Code:
  1. bool AttributesModel::setData(const QModelIndex &index, const QVariant &value, int role)
  2. {
  3. if(index.column() == STATUS_INDEX) {
  4. bool ret = QSqlTableModel::setData(index, value == Qt::Checked ? Qt::Unchecked : Qt::Checked, role);
  5. database().commit();
  6. this->submitAll();
  7. return ret;
  8. }
  9. return QSqlTableModel::setData(index, value, role);
  10. }
To copy to clipboard, switch view to plain text mode