KPeople

personssortfilterproxymodel.h
1 /*
2  SPDX-FileCopyrightText: 2015 Aleix Pol i Gonzalez <[email protected]>
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 
14 namespace KPeople
15 {
16 class 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)
32 public:
33  explicit PersonsSortFilterProxyModel(QObject *parent = nullptr);
34  ~PersonsSortFilterProxyModel() override;
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 
43 private:
44  Q_DISABLE_COPY(PersonsSortFilterProxyModel)
45 
47  Q_DECLARE_PRIVATE(PersonsSortFilterProxyModel)
48 };
49 
50 }
51 
52 #endif // PERSONSSORTFILTERPROXYMODEL_H
SortOrder
Helps filtering and sorting PersonsModel.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:09:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.