Skip to content

Commit

Permalink
itemmodels: Fix assertion errors from debug Qt5 build
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Jun 17, 2020
1 parent 19bd4a2 commit 8639bba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Orange/widgets/utils/itemmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ def __delitem__(self, i):
stop -= 1
else:
start = stop = i = i if i >= 0 else len(self) + i
if stop < start:
return
self._check_sort_order()
self.beginRemoveRows(QModelIndex(), start, stop)
del self._table[i]
Expand All @@ -282,6 +284,8 @@ def __setitem__(self, i, value):
if isinstance(i, slice):
start, stop, _ = _as_contiguous_range(i, len(self))
self.removeRows(start, stop - start)
if len(value) == 0:
return
self.beginInsertRows(QModelIndex(), start, start + len(value) - 1)
self._table[start:start] = value
self._rows = self._table_dim()[0]
Expand Down

0 comments on commit 8639bba

Please sign in to comment.