-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreeitem.h
42 lines (32 loc) · 959 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
#ifndef TREEITEM_H
#define TREEITEM_H
#include <QList>
#include <QVariant>
#include <QPixmap>
//#include <QIcon>
class TreeItem
{
public:
explicit TreeItem(const QStringList &columns, const QString &path2ico, const QVariantList &colData, const int defDataRole = Qt::UserRole, TreeItem *parentItem = 0);
~TreeItem();
void appendChild(TreeItem *child);
TreeItem *child(int row);
int childCount() const;
int columnCount() const;
QVariant data(int column, int role) const;
QVariant data(int column) const;
QString columnText(int column) const;
QPixmap getImage() const;
int row() const;
TreeItem *parentItem();
void setItemData(int column, QVariant data, int role = 0);
void clear();
private:
QList<TreeItem*> m_childItems;
QHash<int, QHash<int,QVariant> > m_itemData;
QPixmap pixmap;
// QIcon m_icon;
QStringList m_itemText;
TreeItem *m_parentItem;
};
#endif // TREEITEM_H