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

Method propertiesContextMenu

plugins/qmlsupport/qmlcontexttab.cpp:77–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void QmlContextTab::propertiesContextMenu(QPoint pos)
78{
79 const auto idx = ui->contextPropertyView->indexAt(pos);
80 if (!idx.isValid())
81 return;
82
83 const auto actions = idx.data(PropertyModel::ActionRole).toInt();
84 const auto objectId = idx.data(PropertyModel::ObjectIdRole).value<ObjectId>();
85 ContextMenuExtension ext(objectId);
86 const bool canShow = (actions == PropertyModel::NavigateTo && !objectId.isNull())
87 || ext.discoverPropertySourceLocation(ContextMenuExtension::GoTo, idx);
88
89 if (!canShow)
90 return;
91
92 QMenu contextMenu;
93 ext.populateMenu(&contextMenu);
94 contextMenu.exec(ui->contextPropertyView->viewport()->mapToGlobal(pos));
95}

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