| 689 | } |
| 690 | |
| 691 | int rowCount(const QModelIndex &parent = QModelIndex()) const override |
| 692 | { |
| 693 | if(!m_Ctx.IsCaptureLoaded()) |
| 694 | return 0; |
| 695 | |
| 696 | // only one root |
| 697 | if(!parent.isValid()) |
| 698 | return 1; |
| 699 | |
| 700 | // only column 1 has children (Qt convention) |
| 701 | if(parent.column() != 0) |
| 702 | return 0; |
| 703 | |
| 704 | if(parent.internalId() == TagRoot) |
| 705 | return m_Nodes[0].rowCount; |
| 706 | |
| 707 | if(parent.internalId() == TagCaptureStart) |
| 708 | return 0; |
| 709 | |
| 710 | // otherwise it's an event |
| 711 | uint32_t eid = (uint32_t)parent.internalId(); |
| 712 | |
| 713 | // if it's a node, return the row count |
| 714 | auto it = m_Nodes.find(eid); |
| 715 | if(it != m_Nodes.end()) |
| 716 | return it->rowCount; |
| 717 | |
| 718 | // no other nodes have children |
| 719 | return 0; |
| 720 | } |
| 721 | |
| 722 | int columnCount(const QModelIndex &parent = QModelIndex()) const override { return COL_COUNT; } |
| 723 | QVariant headerData(int section, Qt::Orientation orientation, int role) const override |
no test coverage detected