With a little help from qt-interest mailinglist i have get the effect i want, and without use persistenteditor or delegate, i have subclassed QSortFilterProxyModel and react there to Qt.CheckStateRole, because i am using the same model in one QDataWidgetMapper, i paste the code here to anyone with this problem in the future, is is python but easily interpretable.

Qt Code:
  1. class GenericSortProxyModel(QSortFilterProxyModel):
  2. def __init__(self, parent):
  3. super(GenericSortProxyModel, self).__init__()
  4. self.booleanSet = set()
  5. self.nullVariant = QVariant()
  6.  
  7. def setParametros(self, booleanColumns=None):
  8. if booleanColumns:
  9. for columna in booleanColumns:
  10. self.booleanSet.add(columna)
  11.  
  12. def flags(self, index):
  13. if not index.isValid():
  14. return Qt.ItemIsEnabled
  15.  
  16. if index.column() in self.booleanSet:
  17. return Qt.ItemIsUserCheckable | Qt.ItemIsSelectable | Qt.ItemIsEnabled
  18. else:
  19. return QSortFilterProxyModel.flags(self, index)
  20.  
  21. def data(self, index, role):
  22. if not index.isValid():
  23. return self.nullVariant()
  24.  
  25. if index.column() in self.booleanSet and role in (Qt.CheckStateRole, Qt.DisplayRole):
  26. if role == Qt.CheckStateRole:
  27. value = QVariant(Qt.Checked) if index.data(Qt.EditRole).toBool() else QVariant(Qt.Unchecked)
  28. return value
  29. else: #if role == Qt.DisplayRole:
  30. return self.nullVariant
  31. else:
  32. return QSortFilterProxyModel.data(self, index, role)
  33.  
  34. def setData(self, index, data, role):
  35. if not index.isValid():
  36. return False
  37.  
  38. if index.column() in self.booleanSet and role == Qt.CheckStateRole:
  39. value = QVariant(True) if data.toInt()[0] == Qt.Checked else QVariant(False)
  40. return QSortFilterProxyModel.setData(self, index, value, Qt.EditRole)
  41. else:
  42. return QSortFilterProxyModel.setData(self, index, data, role)
To copy to clipboard, switch view to plain text mode