|
1 /* |
|
2 * Hedgewars, a free turn based strategy game |
|
3 * Copyright (c) 2004-2018 Andrey Korotaev <unC0Rr@gmail.com> |
|
4 * |
|
5 * This program is free software; you can redistribute it and/or modify |
|
6 * it under the terms of the GNU General Public License as published by |
|
7 * the Free Software Foundation; version 2 of the License |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU General Public License |
|
15 * along with this program; if not, write to the Free Software |
|
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
17 */ |
|
18 |
|
19 /** |
|
20 * @file |
|
21 * @brief Class definition of ThemeFilterProxyModel |
|
22 */ |
|
23 |
|
24 #ifndef HEDGEWARS_THEMEFILTERPROXYMODEL_H |
|
25 #define HEDGEWARS_THEMEFILTERPROXYMODEL_H |
|
26 |
|
27 #include <QSortFilterProxyModel> |
|
28 |
|
29 /** |
|
30 * @brief A filter model for filtering DLC themes |
|
31 */ |
|
32 class ThemeFilterProxyModel : public QSortFilterProxyModel |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: |
|
37 ThemeFilterProxyModel(QObject *parent = 0); |
|
38 void setFilterDLC(bool enabled); |
|
39 |
|
40 protected: |
|
41 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; |
|
42 |
|
43 private: |
|
44 bool isFilteringDLC; |
|
45 }; |
|
46 |
|
47 #endif // HEDGEWARS_THEMEFILTERPROXYMODEL_H |