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 
31 #include <QVector>
32 #include <QVariant>
33 
35 {
44 };
45 
46 class TreeItem
47 {
48 public:
49  explicit TreeItem();
50  virtual ~TreeItem();
51 
52  TreeItem* child(int row);
53 
54  int childCount() const;
55  int columnCount() const;
56  virtual QVariant data(int column) const;
57  bool setData(int column, const QVariant& value);
58 
59  void appendChild(TreeItem* child);
60  bool insertChild(int position, TreeItem* child);
61  bool removeChild(int position);
62 
63  bool insertColumn(int position, QVariant data);
64  bool removeColumn(int position);
65 
66  TreeItem* parent();
67 
68  int row() const;
69 
70  void setEnabled(bool enabled);
71  bool isEnabled();
72 
73 protected:
74  QVector<QVariant> m_itemData;
75  bool enabled;
76 
77 private:
78  TreeItem* m_parentItem;
79  QList<TreeItem*> m_childItems;
80 };
81 
TreeItem::columnCount
int columnCount() const
Definition: treeitem.cpp:59
Scenario.h
TreeItem::m_itemData
QVector< QVariant > m_itemData
Definition: treeitem.h:74
TreeItem
Definition: treeitem.h:46
TreeItem::removeColumn
bool removeColumn(int position)
Definition: treeitem.cpp:147
TreeItem::data
virtual QVariant data(int column) const
Definition: treeitem.cpp:64
TreeItem::parent
TreeItem * parent()
Definition: treeitem.cpp:69
TreeItem::insertChild
bool insertChild(int position, TreeItem *child)
Definition: treeitem.cpp:105
SCENARIOITEMSOURCE
@ SCENARIOITEMSOURCE
Definition: treeitem.h:36
TreeItem::TreeItem
TreeItem()
Definition: treeitem.cpp:34
OPENSCENARIOITEMSOURCE
@ OPENSCENARIOITEMSOURCE
Definition: treeitem.h:42
TreeItem::appendChild
void appendChild(TreeItem *child)
Definition: treeitem.cpp:43
TreeItem::enabled
bool enabled
Definition: treeitem.h:75
SETTINGSITEMSOURCE
@ SETTINGSITEMSOURCE
Definition: treeitem.h:38
TreeItem::childCount
int childCount() const
Definition: treeitem.cpp:54
APPLICATIONITEMSOURCE
@ APPLICATIONITEMSOURCE
Definition: treeitem.h:41
TreeItem::child
TreeItem * child(int row)
Definition: treeitem.cpp:49
SETTINGSITEMPROXY
@ SETTINGSITEMPROXY
Definition: treeitem.h:39
Package.h
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
TreeItem::~TreeItem
virtual ~TreeItem()
Definition: treeitem.cpp:38
APPLICATIONITEMPROXY
@ APPLICATIONITEMPROXY
Definition: treeitem.h:40
TreeItem::isEnabled
bool isEnabled()
Definition: treeitem.cpp:89
TreeItem::setEnabled
void setEnabled(bool enabled)
Definition: treeitem.cpp:84
OPENSCENARIOITEMPROXY
@ OPENSCENARIOITEMPROXY
Definition: treeitem.h:43
ApplicationInstance.h
SCENARIOITEMPROXY
@ SCENARIOITEMPROXY
Definition: treeitem.h:37
TreeItem::setData
bool setData(int column, const QVariant &value)
Definition: treeitem.cpp:94
TreeItem::row
int row() const
Definition: treeitem.cpp:74
TreeItem::removeChild
bool removeChild(int position)
Definition: treeitem.cpp:118
TreeItem::insertColumn
bool insertColumn(int position, QVariant data)
Definition: treeitem.cpp:130
TreeItemTypes
TreeItemTypes
Definition: treeitem.h:34