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

Method registerWidget

src/plugins/core/uicontroller/controller.cpp:490–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490void Controller::registerWidget(const QString &name, AbstractWidget *abstractWidget)
491{
492 if (d->allWidgets.contains(name))
493 return;
494
495 auto widget = static_cast<DWidget *>(abstractWidget->qWidget());
496 if (!widget->parent())
497 widget->setParent(d->mainWindow);
498
499 WidgetInfo widgetInfo;
500 widgetInfo.name = name;
501 widgetInfo.setWidget(widget);
502 widgetInfo.icon = abstractWidget->getDisplayIcon();
503
504 d->allWidgets.insert(name, widgetInfo);
505}
506
507void Controller::registerWidgetCreator(const QString &name, std::function<AbstractWidget *()> &widgetCreateFunc)
508{

Callers 4

startMethod · 0.45
startMethod · 0.45
startMethod · 0.45
addPagesToContextMethod · 0.45

Calls 6

qWidgetMethod · 0.80
getDisplayIconMethod · 0.80
insertMethod · 0.80
containsMethod · 0.45
parentMethod · 0.45
setWidgetMethod · 0.45

Tested by

no test coverage detected