| 106 | } |
| 107 | |
| 108 | void EventMonitorWidget::eventInspectorContextMenu(QPoint pos) |
| 109 | { |
| 110 | const auto idx = ui->eventInspector->indexAt(pos); |
| 111 | if (!idx.isValid()) |
| 112 | return; |
| 113 | |
| 114 | const auto actions = idx.data(PropertyModel::ActionRole).toInt(); |
| 115 | const auto objectId = idx.data(PropertyModel::ObjectIdRole).value<ObjectId>(); |
| 116 | ContextMenuExtension ext(objectId); |
| 117 | const bool canShow = (actions == PropertyModel::NavigateTo && !objectId.isNull()) |
| 118 | || ext.discoverPropertySourceLocation(ContextMenuExtension::GoTo, idx); |
| 119 | if (!canShow) |
| 120 | return; |
| 121 | |
| 122 | QMenu contextMenu; |
| 123 | ext.populateMenu(&contextMenu); |
| 124 | contextMenu.exec(ui->eventInspector->viewport()->mapToGlobal(pos)); |
| 125 | } |
nothing calls this directly
no test coverage detected