Overhaul room list sorting

This commit is contained in:
miruka
2019-04-21 20:55:24 -04:00
parent 424405e3e8
commit 237d750d47
8 changed files with 112 additions and 36 deletions

View File

@@ -48,6 +48,10 @@ class ListModel(QAbstractListModel):
return self.rowCount()
def __iter__(self):
return iter(self._data)
@pyqtProperty(list)
def roles(self) -> Tuple[str, ...]:
return self._data[0].roles if self._data else () # type: ignore
@@ -205,7 +209,7 @@ class ListModel(QAbstractListModel):
valid = self.beginMoveRows(qidx, from_, qlast, qidx, qto)
if not valid:
logging.warning("Invalid move operation")
logging.warning("Invalid move operation - %r", locals())
return
last = from_ + n