electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit d81110014e5a1d32ff424c7a325c7283cd895732
parent 9f9b0954e2868a0e0572f3b3b02e2beaaa028e2d
Author: SomberNight <somber.night@protonmail.com>
Date:   Sat,  7 Dec 2019 04:28:08 +0100

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.

Diffstat:
Melectrum/gui/qt/invoice_list.py | 2+-
Melectrum/gui/qt/request_list.py | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/electrum/gui/qt/invoice_list.py b/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 diff --git a/electrum/gui/qt/request_list.py b/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