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
36{
45 /// ScenarioManager::Data_Structure::Intent of the row, as an int. See ScenarioItem::update().
47};
48
50{
51public:
52 explicit TreeItem();
53 virtual ~TreeItem();
54
55 TreeItem* child(int row);
56
57 int childCount() const;
58 int columnCount() const;
59 virtual QVariant data(int column) const;
60 bool setData(int column, const QVariant& value);
61
63 bool insertChild(int position, TreeItem* child);
64 bool removeChild(int position);
65
66 bool insertColumn(int position, QVariant data);
67 bool removeColumn(int position);
68
70
71 int row() const;
72
73 void setEnabled(bool enabled);
74 bool isEnabled();
75
76protected:
77 QVector<QVariant> m_itemData;
78 bool enabled;
79
80private:
81 TreeItem* m_parentItem;
82 QList<TreeItem*> m_childItems;
83};
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:78
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:77
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
@ SCENARIOITEMPENDINGINTENT
ScenarioManager::Data_Structure::Intent of the row, as an int. See ScenarioItem::update().
Definition treeitem.h:46
@ OPENSCENARIOITEMPROXY
Definition treeitem.h:44
@ SETTINGSITEMSOURCE
Definition treeitem.h:39