Hi! I have exactly same problem. Row remains visible in the view until submitAll execution, whitch is rather strange and confusing. At least because when you edit existant item, new value is shown until you ccommit or discard data.
Here is slot, that I use to delete selected rows:
def _removeSelectedStatuses(self):
'''
УдалÑет выбранные Ñтроки из таблицы
pre[self]: self._model is not None
'''
model = self.ConservationStatusesTableView.selectionModel()
l = model.selectedRows()
if not len(l): return
rows = set([i.row() for i in l])
rows = list(rows)
rows.sort()
first = rows[0]
count = len(rows)
self._model.removeRows(first, count)
def _removeSelectedStatuses(self):
'''
УдалÑет выбранные Ñтроки из таблицы
pre[self]: self._model is not None
'''
model = self.ConservationStatusesTableView.selectionModel()
l = model.selectedRows()
if not len(l): return
rows = set([i.row() for i in l])
rows = list(rows)
rows.sort()
first = rows[0]
count = len(rows)
self._model.removeRows(first, count)
To copy to clipboard, switch view to plain text mode
If you know the answer, please, feel free to post it at
http://stackoverflow.com/questions/4...-i-doing-wrong
too.
Bookmarks