2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2024-01-01 17:07:58 +00:00
|
|
|
// SPDX-FileCopyrightText: 2020-2024 The Monero Project
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#ifndef FEATHER_SUBADDRESSPROXYMODEL_H
|
|
|
|
#define FEATHER_SUBADDRESSPROXYMODEL_H
|
|
|
|
|
|
|
|
#include "libwalletqt/Subaddress.h"
|
|
|
|
|
|
|
|
#include <QSortFilterProxyModel>
|
|
|
|
|
|
|
|
class SubaddressProxyModel : public QSortFilterProxyModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2023-11-16 15:26:58 +00:00
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
public:
|
2023-11-16 15:26:58 +00:00
|
|
|
explicit SubaddressProxyModel(QObject* parent, Subaddress *subaddress);
|
|
|
|
[[nodiscard]] bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setSearchFilter(const QString& searchString){
|
|
|
|
m_searchRegExp.setPattern(searchString);
|
|
|
|
m_searchCaseSensitiveRegExp.setPattern(searchString);
|
|
|
|
invalidateFilter();
|
|
|
|
}
|
2021-03-14 21:12:02 +00:00
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
private:
|
|
|
|
Subaddress *m_subaddress;
|
2022-03-04 10:05:20 +00:00
|
|
|
QRegularExpression m_searchRegExp;
|
|
|
|
QRegularExpression m_searchCaseSensitiveRegExp;
|
2020-10-07 10:36:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //FEATHER_SUBADDRESSPROXYMODEL_H
|