MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / bindCommandShortcut

Method bindCommandShortcut

ChatView/ChatView.cpp:76–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void ChatView::bindCommandShortcut(Utils::Id commandId,
77 const std::function<void()> &onActivated)
78{
79 auto command = Core::ActionManager::command(commandId);
80 if (!command)
81 return;
82
83 auto shortcut = new QShortcut(command->keySequence(), this);
84 connect(shortcut, &QShortcut::activated, this, onActivated);
85 connect(command, &Core::Command::keySequenceChanged, shortcut, [command, shortcut]() {
86 shortcut->setKey(command->keySequence());
87 });
88}
89
90void ChatView::closeEvent(QCloseEvent *event)
91{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected