MCPcopy Create free account
hub / github.com/KDE/kdevelop / declarationMenu

Method declarationMenu

plugins/contextbrowser/contextbrowserview.cpp:147–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void ContextBrowserView::declarationMenu()
148{
149 DUChainReadLocker lock(DUChain::lock());
150
151 auto* navigationWidget = qobject_cast<AbstractNavigationWidget*>(m_navigationWidget.data());
152 if (navigationWidget) {
153 auto* navigationContext = qobject_cast<AbstractDeclarationNavigationContext*>(navigationWidget->context().data());
154 if (navigationContext && navigationContext->declaration().data()) {
155 auto* c = new KDevelop::DeclarationContext(navigationContext->declaration().data());
156 lock.unlock();
157 QMenu menu(this);
158 QList<ContextMenuExtension> extensions =
159 ICore::self()->pluginController()->queryPluginsForContextMenuExtensions(c, &menu);
160
161 ContextMenuExtension::populateMenu(&menu, extensions);
162 menu.exec(QCursor::pos());
163 }
164 }
165}
166
167ContextBrowserView::ContextBrowserView(ContextBrowserPlugin* plugin, QWidget* parent) : QWidget(parent)
168 , m_plugin(plugin)

Callers

nothing calls this directly

Calls 7

pluginControllerMethod · 0.80
execMethod · 0.80
dataMethod · 0.45
contextMethod · 0.45
declarationMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected