feather/src/model/TransactionHistoryProxyModel.h

34 lines
903 B
C
Raw Normal View History

// SPDX-License-Identifier: BSD-3-Clause
2024-01-01 17:07:58 +00:00
// SPDX-FileCopyrightText: 2020-2024 The Monero Project
#ifndef FEATHER_TRANSACTIONHISTORYPROXYMODEL_H
#define FEATHER_TRANSACTIONHISTORYPROXYMODEL_H
2021-06-28 17:20:16 +00:00
#include <QSortFilterProxyModel>
#include "libwalletqt/TransactionHistory.h"
#include "libwalletqt/Wallet.h"
class TransactionHistoryProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit TransactionHistoryProxyModel(Wallet *wallet, QObject* parent = nullptr);
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
2021-03-08 20:03:20 +00:00
TransactionHistory* history();
public slots:
void setSearchFilter(const QString& searchString){
m_searchRegExp.setPattern(searchString);
invalidateFilter();
}
private:
2021-02-03 18:36:03 +00:00
Wallet *m_wallet;
TransactionHistory *m_history;
2021-06-28 17:20:16 +00:00
QRegularExpression m_searchRegExp;
};
#endif //FEATHER_TRANSACTIONHISTORYPROXYMODEL_H