summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-16 15:09:23 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-16 15:09:23 (GMT)
commite51448532f837d3ac28ea3c9b03f711df1940803 (patch)
treead8582a7a311384002e16e706dcc376c50fd7e2d /Swift/QtUI/EventViewer/EventModel.cpp
parent1e42aa0003876f5416f723d535ca27e7b2f6dc68 (diff)
downloadswift-e51448532f837d3ac28ea3c9b03f711df1940803.zip
swift-e51448532f837d3ac28ea3c9b03f711df1940803.tar.bz2
Slighly better rendering for the Event view.
Diffstat (limited to 'Swift/QtUI/EventViewer/EventModel.cpp')
-rw-r--r--Swift/QtUI/EventViewer/EventModel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/EventViewer/EventModel.cpp b/Swift/QtUI/EventViewer/EventModel.cpp
index 065c3eb..a19027a 100644
--- a/Swift/QtUI/EventViewer/EventModel.cpp
+++ b/Swift/QtUI/EventViewer/EventModel.cpp
@@ -39,6 +39,17 @@ QVariant EventModel::data(const QModelIndex& index, int role) const {
return result;
}
+/*
+ * We only reimplement this to get the pointers inside the indices.
+ */
+QModelIndex EventModel::index(int row, int column, const QModelIndex & parent) const {
+ if (!hasIndex(row, column, parent) || parent.isValid()) {
+ return QModelIndex();
+ }
+
+ return row < rowCount() ? createIndex(row, column, getItem(row)) : QModelIndex();
+}
+
int EventModel::rowCount(const QModelIndex& parent) const {
/* Invalid parent = root, valid parent = child, and we're a list not a tree.*/
int count = parent.isValid() ? 0 : activeEvents_.size() + inactiveEvents_.size();