diff options
author | Cozz Lovan <cozzlovan@yahoo.com> | 2014-01-18 00:01:14 +0100 |
---|---|---|
committer | Cozz Lovan <cozzlovan@yahoo.com> | 2014-01-19 18:21:54 +0100 |
commit | 4d901023b732efb492d89cebd8555c689ab7663e (patch) | |
tree | 68956b053435bc164a33389ee3fb466f1b8e0cd1 /src/qt/recentrequeststablemodel.h | |
parent | 8476d5d407645229faf3017b390f041ce0666247 (diff) |
[Qt] Add sorting feature to the requested payments table
Diffstat (limited to 'src/qt/recentrequeststablemodel.h')
-rw-r--r-- | src/qt/recentrequeststablemodel.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index f939c76666..6b20402f78 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -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; |