forked from hyperlogic/animedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreeitem.h
45 lines (37 loc) · 1014 Bytes
/
treeitem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// TreeItem
//
// Created by Anthony Thibault on 6/5/2019
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_TreeItem_h
#define hifi_TreeItem_h
#include <QList>
#include <QVariant>
class TreeItem
{
public:
explicit TreeItem(const QList<QVariant>& data);
~TreeItem();
void appendChild(TreeItem* child);
int findChild(TreeItem* child);
void removeChild(int index);
void insertChild(int index, TreeItem* child);
TreeItem* child(int row);
int childCount() const;
int columnCount() const;
QVariant data(int column) const;
bool setData(int column, const QVariant& value);
int row() const;
TreeItem* parentItem();
TreeItem* cloneNode() const;
TreeItem* cloneNodeAndChildren() const;
private:
QList<TreeItem*> m_childItems;
QList<QVariant> m_itemData;
TreeItem* m_parentItem;
};
#endif