OGS
TreeItem.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <QList>
18#include <QVariant>
19
28{
29public:
30 TreeItem(QList<QVariant> data, TreeItem* parent);
31 virtual ~TreeItem();
32
33 void appendChild(TreeItem* item);
34 TreeItem* child(int row) const;
35 virtual int childCount() const;
36 virtual int columnCount() const;
37 virtual QVariant data(int column) const;
38 virtual bool setData(int column, const QVariant &value);
39 int row() const;
40 TreeItem* parentItem() const;
41 bool removeChildren(int position, int count);
42
43private:
44 QList<TreeItem*> _childItems;
45 QList<QVariant> _itemData;
47};
Objects nodes for the TreeModel.
Definition TreeItem.h:28
virtual int childCount() const
Definition TreeItem.cpp:65
void appendChild(TreeItem *item)
Definition TreeItem.cpp:42
virtual int columnCount() const
Definition TreeItem.cpp:86
QList< TreeItem * > _childItems
Definition TreeItem.h:44
TreeItem * parentItem() const
Definition TreeItem.cpp:115
TreeItem * child(int row) const
Definition TreeItem.cpp:52
virtual ~TreeItem()
Definition TreeItem.cpp:34
TreeItem * _parentItem
Definition TreeItem.h:46
int row() const
Definition TreeItem.cpp:73
bool removeChildren(int position, int count)
Definition TreeItem.cpp:124
virtual bool setData(int column, const QVariant &value)
Definition TreeItem.cpp:102
TreeItem(QList< QVariant > data, TreeItem *parent)
Definition TreeItem.cpp:23
virtual QVariant data(int column) const
Definition TreeItem.cpp:94
QList< QVariant > _itemData
Definition TreeItem.h:45