diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include @@ -84,23 +86,23 @@ QString::fromStdString(EncodeCashAddr( address.dest, parent->walletModel->getChainParams())))); } - // qLowerBound() and qUpperBound() require our cachedAddressTable list - // to be sorted in asc order. Even though the map is already sorted this - // re-sorting step is needed because the originating map is sorted by - // binary address, not by base58() address. - qSort(cachedAddressTable.begin(), cachedAddressTable.end(), - AddressTableEntryLessThan()); + // std::lower_bound() and std::upper_bound() require our + // cachedAddressTable list to be sorted in asc order Even though the map + // is already sorted this re-sorting step is needed because the + // originating map is sorted by binary address, not by base58() address. + std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), + AddressTableEntryLessThan()); } void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status) { // Find address / label in model - QList::iterator lower = - qLowerBound(cachedAddressTable.begin(), cachedAddressTable.end(), - address, AddressTableEntryLessThan()); - QList::iterator upper = - qUpperBound(cachedAddressTable.begin(), cachedAddressTable.end(), - address, AddressTableEntryLessThan()); + QList::iterator lower = std::lower_bound( + cachedAddressTable.begin(), cachedAddressTable.end(), address, + AddressTableEntryLessThan()); + QList::iterator upper = std::upper_bound( + cachedAddressTable.begin(), cachedAddressTable.end(), address, + AddressTableEntryLessThan()); int lowerIndex = (lower - cachedAddressTable.begin()); int upperIndex = (upper - cachedAddressTable.begin()); bool inModel = (lower != upper); diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -12,6 +12,8 @@ #include #include +#include + #include #include @@ -57,11 +59,12 @@ cachedBanlist.append(banEntry); } - if (sortColumn >= 0) + if (sortColumn >= 0) { // sort cachedBanlist (use stable sort to prevent rows jumping // around unnecessarily) - qStableSort(cachedBanlist.begin(), cachedBanlist.end(), - BannedNodeLessThan(sortColumn, sortOrder)); + std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), + BannedNodeLessThan(sortColumn, sortOrder)); + } } int size() const { return cachedBanlist.size(); } diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -12,6 +12,8 @@ #include #include // for cs_main +#include + #include #include #include @@ -73,8 +75,8 @@ if (sortColumn >= 0) { // sort cacheNodeStats (use stable sort to prevent rows jumping // around unnecessarily) - qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), - NodeLessThan(sortColumn, sortOrder)); + std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), + NodeLessThan(sortColumn, sortOrder)); } // build index map diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -195,7 +196,8 @@ } void RecentRequestsTableModel::sort(int column, Qt::SortOrder order) { - qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order)); + std::sort(list.begin(), list.end(), + RecentRequestEntryLessThan(column, order)); Q_EMIT dataChanged( index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex())); diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include #include #include @@ -89,9 +91,9 @@ QString::number(status); // Find bounds of this transaction in model - QList::iterator lower = qLowerBound( + QList::iterator lower = std::lower_bound( cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); - QList::iterator upper = qUpperBound( + QList::iterator upper = std::upper_bound( cachedWallet.begin(), cachedWallet.end(), txid, TxLessThan()); int lowerIndex = (lower - cachedWallet.begin()); int upperIndex = (upper - cachedWallet.begin());