mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[Qt] Add sorting feature to the requested payments table
This commit is contained in:
@@ -41,6 +41,18 @@ public:
|
||||
)
|
||||
};
|
||||
|
||||
class RecentRequestEntryLessThan
|
||||
{
|
||||
public:
|
||||
RecentRequestEntryLessThan(int nColumn, Qt::SortOrder fOrder):
|
||||
column(nColumn), order(fOrder) {}
|
||||
bool operator()(RecentRequestEntry &left, RecentRequestEntry &right ) const;
|
||||
|
||||
private:
|
||||
int column;
|
||||
Qt::SortOrder order;
|
||||
};
|
||||
|
||||
/** Model for list of recently generated payment requests / bitcoin URIs.
|
||||
* Part of wallet model.
|
||||
*/
|
||||
@@ -56,7 +68,8 @@ public:
|
||||
Date = 0,
|
||||
Label = 1,
|
||||
Message = 2,
|
||||
Amount = 3
|
||||
Amount = 3,
|
||||
NUMBER_OF_COLUMNS
|
||||
};
|
||||
|
||||
/** @name Methods overridden from QAbstractTableModel
|
||||
@@ -76,6 +89,9 @@ public:
|
||||
void addNewRequest(const std::string &recipient);
|
||||
void addNewRequest(RecentRequestEntry &recipient);
|
||||
|
||||
public slots:
|
||||
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
|
||||
private:
|
||||
WalletModel *walletModel;
|
||||
QStringList columns;
|
||||
|
||||
Reference in New Issue
Block a user