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;
58 const auto collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
92bool ContactsFilterProxyModel::lessThan(const QModelIndex &leftIndex, const QModelIndex &rightIndex) const
111void ContactsFilterProxyModel::setMatchFilterContactFlag(ContactsFilterProxyModel::MatchFilterContactFlag flag)
135 const auto collection = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
175static bool contactMatchesFilter(const KContacts::Addressee &contact, const QString &filterString, ContactsFilterProxyModel::MatchFilterContactFlag flag)
177 if (TextUtils::ConvertText::normalize(contact.assembledName()).contains(filterString, Qt::CaseInsensitive)) {
181 if (TextUtils::ConvertText::normalize(contact.formattedName()).contains(filterString, Qt::CaseInsensitive)) {
185 if (TextUtils::ConvertText::normalize(contact.nickName()).contains(filterString, Qt::CaseInsensitive)) {
214 if (TextUtils::ConvertText::normalize(emails.at(i)).contains(filterString, Qt::CaseInsensitive)) {
231 if (TextUtils::ConvertText::normalize(contact.title()).contains(filterString, Qt::CaseInsensitive)) {
239 if (TextUtils::ConvertText::normalize(contact.organization()).contains(filterString, Qt::CaseInsensitive)) {
243 if (TextUtils::ConvertText::normalize(contact.department()).contains(filterString, Qt::CaseInsensitive)) {
247 if (TextUtils::ConvertText::normalize(contact.note()).contains(filterString, Qt::CaseInsensitive)) {
267bool contactGroupMatchesFilter(const KContacts::ContactGroup &group, const QString &filterString)
269 if (TextUtils::ConvertText::normalize(group.name()).contains(filterString, Qt::CaseInsensitive)) {
275 if (TextUtils::ConvertText::normalize(group.data(i).name()).contains(filterString, Qt::CaseInsensitive)) {
278 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:121
void setFilterFlags(ContactsFilterProxyModel::FilterFlags flags)
Sets the filter flags.
Definition contactsfilterproxymodel.cpp:116
~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:48
void setMatchFilterContactFlag(ContactsFilterProxyModel::MatchFilterContactFlag flag)
setMatchFilterContactFlag
Definition contactsfilterproxymodel.cpp:111
CollectionRole
T payload() const
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
void setDynamicSortFilter(bool enable)
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 Tue Mar 26 2024 11:13:20 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:20 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.