diff options
Diffstat (limited to 'Swift/QtUI/EventViewer/EventModel.cpp')
-rw-r--r-- | Swift/QtUI/EventViewer/EventModel.cpp | 11 |
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(); |