| 168 | } |
| 169 | |
| 170 | TreeItem* TreeModel::getItem(const QModelIndex& index) const { |
| 171 | if (index.isValid()) { |
| 172 | auto* item = static_cast<TreeItem*>(index.internalPointer()); |
| 173 | if (item) |
| 174 | return item; |
| 175 | } |
| 176 | return rootItem; |
| 177 | } |
| 178 | |
| 179 | QVariant TreeModel::headerData(int section, Qt::Orientation orientation, int role) const { |
| 180 | if (orientation == Qt::Horizontal && role == Qt::DisplayRole) |