| 266 | } |
| 267 | |
| 268 | Variable* VariableTree::selectedVariable() const |
| 269 | { |
| 270 | if (selectionModel()->selectedRows().isEmpty()) return nullptr; |
| 271 | auto item = selectionModel()->currentIndex().data(TreeModel::ItemRole).value<TreeItem*>(); |
| 272 | if (!item) return nullptr; |
| 273 | return qobject_cast<Variable*>(item); |
| 274 | } |
| 275 | |
| 276 | void VariableTree::contextMenuEvent(QContextMenuEvent* event) |
| 277 | { |
no test coverage detected