Krita Source Code Documentation
Loading...
Searching...
No Matches
KisStorageFilterProxyModel.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KISSTORAGEFILTERPROXYMODEL_H
8#define KISSTORAGEFILTERPROXYMODEL_H
9
10#include <QSortFilterProxyModel>
11#include <QObject>
12#include <KisResourceStorage.h>
13#include <KisStorageModel.h>
14#include "kritaresources_export.h"
15
25class KRITARESOURCES_EXPORT KisStorageFilterProxyModel : public QSortFilterProxyModel
26{
27 Q_OBJECT
28public:
29 KisStorageFilterProxyModel(QObject *parent = 0);
31
33 ByFileName = 0,
36 ByActive
38 };
39
40 KisResourceStorageSP storageForIndex(QModelIndex index = QModelIndex()) const;
41
42 void setFilter(FilterType filterType, QVariant filter);
43
44protected:
45
46 bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override;
47 bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
48 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
49
50private Q_SLOTS:
51 void slotModelReset();
52
53
54private:
55 struct Private;
56 Private *const d;
57
58 Q_DISABLE_COPY(KisStorageFilterProxyModel)
59};
60
61#endif
@ ByStorageType
Pass a string list of storage types.