MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / registerToSidebar

Method registerToSidebar

src/plugins/find/findplugin.cpp:78–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void FindPlugin::registerToSidebar()
79{
80 QAction *action = new QAction(MWNA_ADVANCEDSEARCH, this);
81 action->setIcon(QIcon::fromTheme("search"));
82 auto actionImpl = new AbstractAction(action);
83 windowService->addNavigationItem(actionImpl, Priority::highest);
84
85 std::function<AbstractWidget *()> findCreator = [this]() -> AbstractWidget * {
86 advSearchWidget = new AdvancedSearchWidget();
87 advSearchWidget->initOperator();
88 return new AbstractWidget(advSearchWidget);
89 };
90
91 windowService->registerWidgetCreator(MWNA_ADVANCEDSEARCH, findCreator);
92 windowService->setDockHeaderName(MWNA_ADVANCEDSEARCH, tr("ADVANCED SEARCH"));
93 windowService->bindWidgetToNavigation(MWNA_ADVANCEDSEARCH, actionImpl);
94
95 connect(action, &QAction::triggered, this, &FindPlugin::switchToSearch, Qt::DirectConnection);
96}

Callers

nothing calls this directly

Calls 7

connectFunction · 0.85
addNavigationItemMethod · 0.80
initOperatorMethod · 0.80
registerWidgetCreatorMethod · 0.80
setIconMethod · 0.45
setDockHeaderNameMethod · 0.45

Tested by

no test coverage detected