qt requests/invoices: use TreeView.sortByColumn instead of model.sort

sort the view, not the model
This way, qt will display the icon indicating the sort order on the relevant column header.
This commit is contained in:
SomberNight 2019-12-07 04:28:08 +01:00
parent 9f9b0954e2
commit d81110014e
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 2 additions and 2 deletions

View file

@ -129,7 +129,7 @@ class InvoiceList(MyTreeView):
self.selectionModel().select(self.model().index(0,0), QItemSelectionModel.SelectCurrent)
# sort requests by date
self.model().sort(self.Columns.DATE)
self.sortByColumn(self.Columns.DATE, Qt.AscendingOrder)
# hide list if empty
if self.parent.isVisible():
b = self.model().rowCount() > 0

View file

@ -138,7 +138,7 @@ class RequestList(MyTreeView):
self.model().insertRow(self.model().rowCount(), items)
self.filter()
# sort requests by date
self.model().sort(self.Columns.DATE)
self.sortByColumn(self.Columns.DATE, Qt.AscendingOrder)
# hide list if empty
if self.parent.isVisible():
b = self.model().rowCount() > 0