blob: 714beb2168f0384663447cd078f1b3b6741c8d16 (
plain)
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
|
#include "Roster/QtTreeWidget.h"
#include "Swiften/Base/Platform.h"
#include "Swiften/Roster/OpenChatRosterAction.h"
namespace Swift {
QtTreeWidget::QtTreeWidget(QWidget* parent) : QTreeView(parent) {
treeRoot_ = new QtTreeWidgetItem(NULL);
model_ = new RosterModel();
model_->setRoot(treeRoot_);
setModel(model_);
delegate_ = new RosterDelegate();
setItemDelegate(delegate_);
setHeaderHidden(true);
#ifdef SWIFT_PLATFORM_MACOSX
setAlternatingRowColors(true);
#endif
setAnimated(true);
setIndentation(0);
setRootIsDecorated(true);
//connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(handleItemActivated(QTreeWidgetItem*, int)));
}
QtTreeWidget::~QtTreeWidget() {
delete model_;
delete delegate_;
}
QtTreeWidgetItem* QtTreeWidget::getRoot() {
return treeRoot_;
}
// void QtTreeWidget::handleItemActivated(QTreeWidgetItem* item, int column) {
// QtTreeWidgetItem* qtItem = dynamic_cast<QtTreeWidgetItem*>(item);
// if (qtItem) {
// qtItem->performUserAction(boost::shared_ptr<UserRosterAction>(new OpenChatRosterAction()));
// }
// }
void QtTreeWidget::drawBranches(QPainter*, const QRect&, const QModelIndex&) const {
}
void QtTreeWidget::show() {
QWidget::show();
}
}
|