summaryrefslogtreecommitdiffstats
blob: fda957da57299ed460dba75343ecdaa19c4371b3 (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
#include "Swift/QtUI/EventViewer/QtEventWindow.h"

#include "Swiften/Base/Platform.h"

namespace Swift {

QtEventWindow::QtEventWindow(QWidget* parent) : QTreeView(parent) {
	model_ = new EventModel();
	setModel(model_);
	delegate_ = new EventDelegate();
	setItemDelegate(delegate_);
	setHeaderHidden(true);
#ifdef SWIFT_PLATFORM_MACOSX
	setAlternatingRowColors(true);
#endif
	setAnimated(true);
	setIndentation(0);
	setRootIsDecorated(true);
}

QtEventWindow::~QtEventWindow() {
	delete model_;
	delete delegate_;
}

void QtEventWindow::addEvent(boost::shared_ptr<Event> event, bool active) {
	model_->addEvent(event, active);
}

void QtEventWindow::removeEvent(boost::shared_ptr<Event> event) {
	model_->removeEvent(event);
}

}