Browse Source

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.
hard-fail-on-bad-server-string
SomberNight 5 years ago
parent
commit
d81110014e
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qt/invoice_list.py
  2. 2
      electrum/gui/qt/request_list.py

2
electrum/gui/qt/invoice_list.py

@ -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

2
electrum/gui/qt/request_list.py

@ -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

Loading…
Cancel
Save