Rename ListModel.update() to updateItem()
This commit is contained in:
parent
2a687f8eee
commit
45c928ea17
|
@ -238,10 +238,10 @@ class ListModel(QAbstractListModel):
|
||||||
@pyqtSlot(int, "QVariantMap", "QStringList", result=int)
|
@pyqtSlot(int, "QVariantMap", "QStringList", result=int)
|
||||||
@pyqtSlot(str, "QVariantMap", result=int)
|
@pyqtSlot(str, "QVariantMap", result=int)
|
||||||
@pyqtSlot(str, "QVariantMap", "QStringList", result=int)
|
@pyqtSlot(str, "QVariantMap", "QStringList", result=int)
|
||||||
def update(self,
|
def updateItem(self,
|
||||||
index: Index,
|
index: Index,
|
||||||
value: NewItem,
|
value: NewItem,
|
||||||
ignore_roles: Sequence[str] = ()) -> int:
|
ignore_roles: Sequence[str] = ()) -> int:
|
||||||
value = self._convert_new_value(value)
|
value = self._convert_new_value(value)
|
||||||
|
|
||||||
i_index: int = self.indexWhere(index, _can_use_default_factory=False) \
|
i_index: int = self.indexWhere(index, _can_use_default_factory=False) \
|
||||||
|
@ -283,7 +283,9 @@ class ListModel(QAbstractListModel):
|
||||||
new_index_if_update: Optional[int] = None,
|
new_index_if_update: Optional[int] = None,
|
||||||
ignore_roles: Sequence[str] = ()) -> None:
|
ignore_roles: Sequence[str] = ()) -> None:
|
||||||
try:
|
try:
|
||||||
index = self.update(where_main_key_is, update_with, ignore_roles)
|
index = self.updateItem(
|
||||||
|
where_main_key_is, update_with, ignore_roles
|
||||||
|
)
|
||||||
except (IndexError, ValueError):
|
except (IndexError, ValueError):
|
||||||
self.insert(new_index_if_insert or len(self), update_with)
|
self.insert(new_index_if_insert or len(self), update_with)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -336,7 +336,7 @@ class SignalManager(QObject):
|
||||||
break
|
break
|
||||||
|
|
||||||
if update_at is not None:
|
if update_at is not None:
|
||||||
model.update(update_at, new_event)
|
model.updateItem(update_at, new_event)
|
||||||
self._events_in_transfer -= 1
|
self._events_in_transfer -= 1
|
||||||
return new_event
|
return new_event
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user