You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wowlet/src/model/SubaddressProxyModel.h

39 lines
1.0 KiB

// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#ifndef WOWLET_SUBADDRESSPROXYMODEL_H
#define WOWLET_SUBADDRESSPROXYMODEL_H
#include "libwalletqt/Subaddress.h"
#include <QSortFilterProxyModel>
class SubaddressProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit SubaddressProxyModel(QObject* parent, Subaddress *subaddress, bool hidePrimary = true);
bool filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const;
public slots:
void setSearchFilter(const QString& searchString){
m_searchRegExp.setPattern(searchString);
m_searchCaseSensitiveRegExp.setPattern(searchString);
invalidateFilter();
}
void setShowUsed(const bool showUsed){
m_showUsed = showUsed;
invalidateFilter();
}
private:
Subaddress *m_subaddress;
QRegExp m_searchRegExp;
QRegExp m_searchCaseSensitiveRegExp;
bool m_showUsed = false;
bool m_hidePrimary;
};
#endif //WOWLET_SUBADDRESSPROXYMODEL_H