KPeople

personssortfilterproxymodel.h
1/*
2 SPDX-FileCopyrightText: 2015 Aleix Pol i Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef PERSONSSORTFILTERPROXYMODEL_H
8#define PERSONSSORTFILTERPROXYMODEL_H
9
10#include <QScopedPointer>
11#include <QSortFilterProxyModel>
12#include <kpeople/kpeople_export.h>
13
14namespace KPeople
15{
16class PersonsSortFilterProxyModelPrivate;
17
18/**
19 * Helps filtering and sorting PersonsModel
20 *
21 * Especially useful for creating interfaces around specific properties rather
22 * than the complete set as a whole.
23 *
24 * @sa PersonsModel
25 * @since 5.12
26 */
28{
29 Q_OBJECT
30 /** Specifies the properties that should be provided by the contact for the contact to be shown. */
31 Q_PROPERTY(QStringList requiredProperties READ requiredProperties WRITE setRequiredProperties)
32public:
33 explicit PersonsSortFilterProxyModel(QObject *parent = nullptr);
35
36 QStringList requiredProperties() const;
37 void setRequiredProperties(const QStringList &props);
38
39 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
40
41 Q_INVOKABLE void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
42
43private:
44 Q_DISABLE_COPY(PersonsSortFilterProxyModel)
45
47 Q_DECLARE_PRIVATE(PersonsSortFilterProxyModel)
48};
49
50}
51
52#endif // PERSONSSORTFILTERPROXYMODEL_H
Helps filtering and sorting PersonsModel.
SortOrder
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:46 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.