summaryrefslogtreecommitdiffstats
blob: b4be622f5016cd691072722f954d8532310e358b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2016 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <QSortFilterProxyModel>

namespace Swift {

/**
 * @brief The QtLeafSortFilterProxyModel class is similar to the QSortFilterProxyModel
 * class. While the basic QSortFilterProxyModel class filters all hierarchical items,
 * the QtLeafSortFilterProxyModel class will only filter on items without children.
 */
class QtLeafSortFilterProxyModel : public QSortFilterProxyModel {
    Q_OBJECT

public:
    QtLeafSortFilterProxyModel(QObject* parent = nullptr);
    virtual ~QtLeafSortFilterProxyModel();

protected:
    virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
};

}