| 74 | } |
| 75 | |
| 76 | void 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 | |
| 90 | void ChatView::closeEvent(QCloseEvent *event) |
| 91 | { |
nothing calls this directly
no outgoing calls
no test coverage detected