Feather, a free Monero desktop wallet

Co-Authored-By: tobtoht <thotbot@protonmail.com>
This commit is contained in:
dsc
2020-10-08 04:31:22 +02:00
co-authored by tobtoht
commit 133700160a
728 changed files with 55961 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020, The Monero Project.
#include "AddressBookProxyModel.h"
#include "AddressBookModel.h"
AddressBookProxyModel::AddressBookProxyModel(QObject *parent)
: QSortFilterProxyModel(parent),
m_searchRegExp("")
{
m_searchRegExp.setCaseSensitivity(Qt::CaseInsensitive);
m_searchRegExp.setPatternSyntax(QRegExp::RegExp);
}
bool AddressBookProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
QModelIndex addressIndex = sourceModel()->index(sourceRow, AddressBookModel::Address, sourceParent);
QModelIndex descriptionIndex = sourceModel()->index(sourceRow, AddressBookModel::Description, sourceParent);
QString addressData = sourceModel()->data(addressIndex, Qt::UserRole).toString();
QString descriptionData = sourceModel()->data(descriptionIndex).toString();
return (addressData.contains(m_searchRegExp) || descriptionData.contains(m_searchRegExp));
}