diff options
Diffstat (limited to 'Swift/QtUI/EventViewer/QtEventWindow.cpp')
-rw-r--r-- | Swift/QtUI/EventViewer/QtEventWindow.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Swift/QtUI/EventViewer/QtEventWindow.cpp b/Swift/QtUI/EventViewer/QtEventWindow.cpp new file mode 100644 index 0000000..fda957d --- /dev/null +++ b/Swift/QtUI/EventViewer/QtEventWindow.cpp @@ -0,0 +1,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); +} + +} |