| 95 | } |
| 96 | |
| 97 | QModelIndex StructSelectModel::parent(const QModelIndex& index) const |
| 98 | { |
| 99 | if (!index.isValid()) |
| 100 | return {}; |
| 101 | |
| 102 | StructTreeNode* childNode = static_cast<StructTreeNode*>(index.internalPointer()); |
| 103 | StructTreeNode* parentNode = childNode->getParent(); |
| 104 | |
| 105 | if (parentNode == m_rootNode || parentNode == nullptr) |
| 106 | return {}; |
| 107 | |
| 108 | return createIndex(parentNode->getRow(), 0, parentNode); |
| 109 | } |
| 110 | |
| 111 | QVariant StructSelectModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 112 | { |
no test coverage detected