From 93bfb93fb3eb6c59a1b8300047ebd2d5b4a432de Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 17 Jan 2023 21:41:02 +0100 Subject: [PATCH] AccountSwitcher: fix sort [2] --- src/model/SubaddressAccountModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/model/SubaddressAccountModel.cpp b/src/model/SubaddressAccountModel.cpp index 06b2b5f..241afa5 100644 --- a/src/model/SubaddressAccountModel.cpp +++ b/src/model/SubaddressAccountModel.cpp @@ -76,6 +76,9 @@ QVariant SubaddressAccountModel::parseSubaddressAccountRow(const Monero::Subaddr { switch (index.column()) { case Number: + if (role == Qt::UserRole) { + return index.row(); + } return QString("#%1").arg(QString::number(index.row())); case Address: return QString::fromStdString(row.getAddress()); @@ -152,4 +155,5 @@ Monero::SubaddressAccountRow* SubaddressAccountModel::entryFromIndex(const QMode SubaddressAccountProxyModel::SubaddressAccountProxyModel(QObject *parent) : QSortFilterProxyModel(parent) { + setSortRole(Qt::UserRole); } \ No newline at end of file