MCPcopy Create free account
hub / github.com/KDAB/GammaRay / eventInspectorContextMenu

Method eventInspectorContextMenu

plugins/eventmonitor/eventmonitorwidget.cpp:108–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void 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}

Callers

nothing calls this directly

Calls 5

populateMenuMethod · 0.80
isValidMethod · 0.45
dataMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected