-
Notifications
You must be signed in to change notification settings - Fork 2
/
drboardnodeitem.cpp
65 lines (38 loc) · 1.09 KB
/
drboardnodeitem.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "drboardnodeitem.h"
DRBoardNodeItem::DRBoardNodeItem(DRServerConnection *connection, DRBoardNodeItem *parent) : QObject()
{
this->_parentItem = parent;
this->_connection = connection;
}
DRBoardNodeItem::~DRBoardNodeItem() {
qDeleteAll(this->_childItems);
}
DRServerConnection * DRBoardNodeItem::getConnection() {
return this->_connection;
}
DRBoardNodeItem * DRBoardNodeItem::child(int row) {
return this->_childItems.value(row);
}
int DRBoardNodeItem::childCount() const {
return this->_childItems.count();
}
int DRBoardNodeItem::columnCount() const {
return 1;
}
QVariant DRBoardNodeItem::data(int column) const {
return "<null>";
}
int DRBoardNodeItem::childNumber() const {
if (this->_parentItem)
return this->_parentItem->_childItems.indexOf(const_cast<DRBoardNodeItem*>(this));
return 0;
}
void DRBoardNodeItem::clear() {
this->_childItems.clear();
}
void DRBoardNodeItem::addChild(DRBoardNodeItem *child) {
this->_childItems.append(child);
}
DRBoardNodeItem * DRBoardNodeItem::parent() {
return this->_parentItem;
}