MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / matchMenuActionUnconditional

Function matchMenuActionUnconditional

src/core/AutomationServer.cpp:633–647  ·  view source on GitHub ↗

Walk a QMenu's actions WITHOUT the isVisible() gate, descending into submenus, so a menu-bar leaf action is reachable even while its menu is closed. The owning QMenu is returned so triggerMenuAction() can route through the closed-menu (action->trigger()) path. (#3646 fidelity — items 5 + 7)

Source from the content-addressed store, hash-verified

631// closed. The owning QMenu is returned so triggerMenuAction() can route through
632// the closed-menu (action->trigger()) path. (#3646 fidelity — items 5 + 7)
633ResolvedAction matchMenuActionUnconditional(QMenu* menu, const QString& target)
634{
635 for (QAction* action : menu->actions()) {
636 if (action->isSeparator())
637 continue;
638 if (actionMatchesTarget(action, target))
639 return {action, menu};
640 if (QMenu* submenu = action->menu()) {
641 const ResolvedAction match = matchMenuActionUnconditional(submenu, target);
642 if (match.action)
643 return match;
644 }
645 }
646 return {};
647}
648
649// Resolve a QAction anywhere in any top-level window's menu bar, regardless of
650// whether the menu is currently open. This is what lets `invoke` drive

Callers 1

resolveMenuBarActionFunction · 0.85

Calls 1

actionMatchesTargetFunction · 0.85

Tested by

no test coverage detected