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

Method modelContextMenu

plugins/modelinspector/modelinspectorwidget.cpp:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void ModelInspectorWidget::modelContextMenu(QPoint pos)
143{
144 const auto index = ui->modelView->indexAt(pos);
145 if (!index.isValid())
146 return;
147
148 const auto objectId = index.data(ObjectModel::ObjectIdRole).value<ObjectId>();
149 QMenu menu;
150 ContextMenuExtension ext(objectId);
151 ext.setLocation(ContextMenuExtension::Creation, index.data(ObjectModel::CreationLocationRole).value<SourceLocation>());
152 ext.setLocation(ContextMenuExtension::Declaration,
153 index.data(ObjectModel::DeclarationLocationRole).value<SourceLocation>());
154 ext.populateMenu(&menu);
155
156 menu.exec(ui->modelView->viewport()->mapToGlobal(pos));
157}
158
159void ModelInspectorWidget::selectionModelContextMenu(QPoint pos)
160{

Callers

nothing calls this directly

Calls 4

setLocationMethod · 0.80
populateMenuMethod · 0.80
isValidMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected