| 69 | TimerTopWidget::~TimerTopWidget() = default; |
| 70 | |
| 71 | void TimerTopWidget::contextMenu(QPoint pos) |
| 72 | { |
| 73 | auto index = ui->timerView->indexAt(pos); |
| 74 | if (!index.isValid()) |
| 75 | return; |
| 76 | index = index.sibling(index.row(), 0); |
| 77 | |
| 78 | const auto objectId = index.data(ObjectModel::ObjectIdRole).value<ObjectId>(); |
| 79 | if (objectId.isNull()) |
| 80 | return; |
| 81 | |
| 82 | QMenu menu; |
| 83 | ContextMenuExtension ext(objectId); |
| 84 | ext.setLocation(ContextMenuExtension::Creation, index.data(ObjectModel::CreationLocationRole).value<SourceLocation>()); |
| 85 | ext.setLocation(ContextMenuExtension::Declaration, index.data(ObjectModel::DeclarationLocationRole).value<SourceLocation>()); |
| 86 | ext.populateMenu(&menu); |
| 87 | menu.exec(ui->timerView->viewport()->mapToGlobal(pos)); |
| 88 | } |
nothing calls this directly
no test coverage detected