filterabletreemodelsortfilterproxymodel.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::core
19 * @author Cedric Seehausen (usdnr at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
26#pragma once
27
28#include <memory>
29
30#include <QModelIndex>
31#include <QSortFilterProxyModel>
32#include <qmetatype.h>
33
35#include "openscenarioitem.h"
36#include "scenarioitem.h"
37#include "settingsitem.h"
38
39/**
40* @class FilterableTreeModelSortFilterProxyModel
41* @brief Model of the FilterableTreeView.
42*/
43class FilterableTreeModelSortFilterProxyModel : public QSortFilterProxyModel
44{
45 Q_OBJECT
46public:
47 /**
48 * Constructor that registers the used meta-types.
49 */
51
52 /**
53 * Returns the data stored at the specified location, based on the given role.
54 * @param proxy_index Model-Index of the item
55 * @param role describes what kind of data is requested
56 */
57 QVariant data(const QModelIndex& proxy_index, int role) const override;
58
59 /**
60 * Returns whether the filter accepts a row.
61 * @param sourceRow index of the row
62 * @param sourceParent index of the parent
63 */
64 bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override;
65};
66
68 std::shared_ptr<FilterableTreeModelSortFilterProxyModel>;
uint8_t data[1]
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Returns whether the filter accepts a row.
FilterableTreeModelSortFilterProxyModel()
Constructor that registers the used meta-types.
std::shared_ptr< FilterableTreeModelSortFilterProxyModel > FilterableTreeModelSortFilterProxyModelPtr