| 1140 | // --------------------------------------------------------------------------- |
| 1141 | |
| 1142 | void installButtonShortcuts(QWidget* root, const PJ::WidgetDataView& view) { |
| 1143 | for (const auto& name : view.widgetNames()) { |
| 1144 | auto sc = view.shortcut(name); |
| 1145 | if (!sc) { |
| 1146 | continue; |
| 1147 | } |
| 1148 | auto* btn = root->findChild<QPushButton*>(QString::fromStdString(name)); |
| 1149 | if (!btn) { |
| 1150 | continue; |
| 1151 | } |
| 1152 | auto* shortcut = new QShortcut(QKeySequence(QString::fromStdString(*sc)), root); |
| 1153 | QObject::connect(shortcut, &QShortcut::activated, btn, &QPushButton::click); |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | } // namespace PJ |
no outgoing calls
no test coverage detected