MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / createContextMenu

Method createContextMenu

launcher/ui/widgets/WideBar.cpp:175–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175QMenu* WideBar::createContextMenu(QWidget* parent, const QString& title)
176{
177 auto* contextMenu = new QMenu(title, parent);
178 for (auto& item : m_entries) {
179 switch (item.type) {
180 default:
181 case BarEntry::Type::None:
182 break;
183 case BarEntry::Type::Separator:
184 case BarEntry::Type::Spacer:
185 contextMenu->addSeparator();
186 break;
187 case BarEntry::Type::Action:
188 contextMenu->addAction(item.menu_action);
189 break;
190 }
191 }
192 return contextMenu;
193}
194
195static void copyAction(QAction* from, QAction* to)
196{

Callers 6

ShowContextMenuMethod · 0.80
ShowContextMenuMethod · 0.80
showContextMenuMethod · 0.80
ShowContextMenuMethod · 0.80
ShowContextMenuMethod · 0.80
ShowContextMenuMethod · 0.80

Calls 2

addSeparatorMethod · 0.80
addActionMethod · 0.80

Tested by

no test coverage detected