Akonadi Contacts
contactsfilterproxymodel.cpp
20static bool contactMatchesFilter(const KContacts::Addressee &contact, const QString &filterString, ContactsFilterProxyModel::MatchFilterContactFlag flag);
21static bool contactGroupMatchesFilter(const KContacts::ContactGroup &group, const QString &filterString);
33 ContactsFilterProxyModel::MatchFilterContactFlag matchFilterFlag = ContactsFilterProxyModel::MatchFilterContactFlag::All;
57 const auto collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
91bool ContactsFilterProxyModel::lessThan(const QModelIndex &leftIndex, const QModelIndex &rightIndex) const
110void ContactsFilterProxyModel::setMatchFilterContactFlag(ContactsFilterProxyModel::MatchFilterContactFlag flag)
134 const auto collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
174static bool contactMatchesFilter(const KContacts::Addressee &contact, const QString &filterString, ContactsFilterProxyModel::MatchFilterContactFlag flag)
176 if (TextUtils::ConvertText::normalize(contact.assembledName()).contains(filterString, Qt::CaseInsensitive)) {
180 if (TextUtils::ConvertText::normalize(contact.formattedName()).contains(filterString, Qt::CaseInsensitive)) {
184 if (TextUtils::ConvertText::normalize(contact.nickName()).contains(filterString, Qt::CaseInsensitive)) {
213 if (TextUtils::ConvertText::normalize(emails.at(i)).contains(filterString, Qt::CaseInsensitive)) {
230 if (TextUtils::ConvertText::normalize(contact.title()).contains(filterString, Qt::CaseInsensitive)) {
238 if (TextUtils::ConvertText::normalize(contact.organization()).contains(filterString, Qt::CaseInsensitive)) {
242 if (TextUtils::ConvertText::normalize(contact.department()).contains(filterString, Qt::CaseInsensitive)) {
246 if (TextUtils::ConvertText::normalize(contact.note()).contains(filterString, Qt::CaseInsensitive)) {
266bool contactGroupMatchesFilter(const KContacts::ContactGroup &group, const QString &filterString)
268 if (TextUtils::ConvertText::normalize(group.name()).contains(filterString, Qt::CaseInsensitive)) {
274 if (TextUtils::ConvertText::normalize(group.data(i).name()).contains(filterString, Qt::CaseInsensitive)) {
277 if (TextUtils::ConvertText::normalize(group.data(i).email()).contains(filterString, Qt::CaseInsensitive)) {
ContactsFilterProxyModel(QObject *parent=nullptr)
Creates a new contacts filter proxy model.
Definition contactsfilterproxymodel.cpp:37
void setExcludeVirtualCollections(bool exclude)
Sets whether we want virtual collections to be filtered or not.
Definition contactsfilterproxymodel.cpp:120
void setFilterFlags(ContactsFilterProxyModel::FilterFlags flags)
Sets the filter flags.
Definition contactsfilterproxymodel.cpp:115
~ContactsFilterProxyModel() override
Destroys the contacts filter proxy model.
void setFilterString(const QString &filter)
Sets the filter that is used to filter for matching contacts and contact groups.
Definition contactsfilterproxymodel.cpp:47
void setMatchFilterContactFlag(ContactsFilterProxyModel::MatchFilterContactFlag flag)
setMatchFilterContactFlag
Definition contactsfilterproxymodel.cpp:110
CollectionRole
QString mailer() const
QStringList emails() const
QString nickName() const
QString organization() const
QStringList customs() const
QString note() const
QDateTime birthday() const
QString role() const
QString title() const
QString assembledName() const
QString formattedName() const
ResourceLocatorUrl url() const
Address::List addresses() const
QStringList categories() const
QString department() const
PhoneNumber::List phoneNumbers() const
QString name() const
QString email() const
Data & data(int index)
QString name() const
int dataCount() const
A widget for editing the display name of a contact.
PostalAddress address(const QVariant &location)
sourceModel
int day() const const
bool isValid(int year, int month, int day)
int month() const const
QString toString(QStringView format, QCalendar cal) const const
const_reference at(qsizetype i) const const
qsizetype count() const const
QVariant data(int role) const const
bool isValid() const const
QObject * parent() const const
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const const
virtual Qt::ItemFlags flags(const QModelIndex &index) const const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
void invalidateFilter()
void setSortLocaleAware(bool on)
virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
CaseInsensitive
typedef ItemFlags
QDate toDate() const const
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.