Add users currently typing in room bar

This commit is contained in:
miruka
2019-04-14 16:12:07 -04:00
parent 14a76b710b
commit 8a3189df15
9 changed files with 85 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ from PyQt5.QtCore import (
)
NewValue = Union[Mapping[str, Any], Sequence]
ReturnItem = Dict[str, Any]
class ListModel(QAbstractListModel):
@@ -96,7 +97,7 @@ class ListModel(QAbstractListModel):
@pyqtSlot(int, result="QVariantMap")
def get(self, index: int) -> Dict[str, Any]:
def get(self, index: int) -> ReturnItem:
return self._list[index]._asdict()
@@ -110,6 +111,11 @@ class ListModel(QAbstractListModel):
f"property {prop!r} set to {is_value!r}.")
@pyqtSlot(str, "QVariant", result="QVariantMap")
def getWhere(self, prop: str, is_value: Any) -> ReturnItem:
return self.get(self.indexWhere(prop, is_value))
@pyqtSlot(int, list)
def insert(self, index: int, value: NewValue) -> None:
value = self._convert_new_value(value)