treeitem.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::gui
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 <QVariant>
29#include <QVector>
30
34
46
48{
49public:
50 explicit TreeItem();
51 virtual ~TreeItem();
52
53 TreeItem* child(int row);
54
55 int childCount() const;
56 int columnCount() const;
57 virtual QVariant data(int column) const;
58 bool setData(int column, const QVariant& value);
59
61 bool insertChild(int position, TreeItem* child);
62 bool removeChild(int position);
63
64 bool insertColumn(int position, QVariant data);
65 bool removeColumn(int position);
66
68
69 int row() const;
70
71 void setEnabled(bool enabled);
72 bool isEnabled();
73
74protected:
75 QVector<QVariant> m_itemData;
76 bool enabled;
77
78private:
79 TreeItem* m_parentItem;
80 QList<TreeItem*> m_childItems;
81};
uint8_t data[1]
int childCount() const
Definition treeitem.cpp:57
bool insertColumn(int position, QVariant data)
Definition treeitem.cpp:143
bool setData(int column, const QVariant &value)
Definition treeitem.cpp:104
void appendChild(TreeItem *child)
Definition treeitem.cpp:44
virtual QVariant data(int column) const
Definition treeitem.cpp:69
void setEnabled(bool enabled)
Definition treeitem.cpp:92
virtual ~TreeItem()
Definition treeitem.cpp:38
int row() const
Definition treeitem.cpp:81
bool removeColumn(int position)
Definition treeitem.cpp:161
bool isEnabled()
Definition treeitem.cpp:98
bool removeChild(int position)
Definition treeitem.cpp:130
bool enabled
Definition treeitem.h:76
bool insertChild(int position, TreeItem *child)
Definition treeitem.cpp:116
TreeItem * parent()
Definition treeitem.cpp:75
int columnCount() const
Definition treeitem.cpp:63
TreeItem * child(int row)
Definition treeitem.cpp:51
QVector< QVariant > m_itemData
Definition treeitem.h:75
TreeItemTypes
Definition treeitem.h:36
@ APPLICATIONITEMSOURCE
Definition treeitem.h:42
@ SETTINGSITEMPROXY
Definition treeitem.h:40
@ SCENARIOITEMSOURCE
Definition treeitem.h:37
@ SCENARIOITEMPROXY
Definition treeitem.h:38
@ OPENSCENARIOITEMSOURCE
Definition treeitem.h:43
@ APPLICATIONITEMPROXY
Definition treeitem.h:41
@ OPENSCENARIOITEMPROXY
Definition treeitem.h:44
@ SETTINGSITEMSOURCE
Definition treeitem.h:39