Sat, 14 Dec 2019 23:00:01 +0200
fixed build
| 16 | 1 | #include "uiutilities.h" |
| 2 | ||
| 3 | QVector<QAction*> uiutilities::collectActions(QObject* subject) | |
| 4 | { | |
| 5 | QVector<QAction*> actions; | |
| 6 | for (QAction* action : subject->findChildren<QAction*>()) | |
| 7 | { | |
| 8 | if (not action->text().isEmpty() | |
| 9 | and action->data().isNull() | |
| 10 | and not action->objectName().isEmpty()) | |
| 11 | { | |
| 12 | actions.push_back(action); | |
| 13 | } | |
| 14 | } | |
| 15 | return actions; | |
| 16 | } | |
| 17 | ||
| 18 | uiutilities::KeySequenceMap uiutilities::makeKeySequenceMap(const QVector<QAction*>& actions) | |
| 19 | { | |
| 20 | KeySequenceMap result; | |
| 21 | for (QAction* action : actions) | |
| 22 | { | |
| 23 | result[action->objectName()] = action->shortcut(); | |
| 24 | } | |
| 25 | return result; | |
| 26 | } |