| 664 | } |
| 665 | |
| 666 | QModelIndex parent(const QModelIndex &index) const override |
| 667 | { |
| 668 | if(!m_Ctx.IsCaptureLoaded() || !index.isValid() || index.internalId() == TagRoot) |
| 669 | return QModelIndex(); |
| 670 | |
| 671 | // Capture Start's parent is the root |
| 672 | if(index.internalId() == TagCaptureStart) |
| 673 | return createIndex(0, 0, TagRoot); |
| 674 | |
| 675 | if(index.internalId() >= m_Actions.size()) |
| 676 | return QModelIndex(); |
| 677 | |
| 678 | // otherwise it's an action |
| 679 | const ActionDescription *action = m_Actions[index.internalId()]; |
| 680 | |
| 681 | // if it has no parent action, the parent is the root |
| 682 | if(action->parent == NULL) |
| 683 | return createIndex(0, 0, TagRoot); |
| 684 | |
| 685 | // the parent must be a node since it has at least one child (this action), so we'll have a |
| 686 | // cached |
| 687 | // index |
| 688 | return m_Nodes[action->parent->eventId].index; |
| 689 | } |
| 690 | |
| 691 | int rowCount(const QModelIndex &parent = QModelIndex()) const override |
| 692 | { |
no test coverage detected