mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-07 04:04:14 +02:00
Add icons, menu locations, key search and copy to the Shortcuts page
The Shortcuts page now shows:
- each command's icon, and a Menu column saying where it is
("Projet › Scripts"); the text filter matches that too
- a category filter beside the existing Bound/Unbound/Conflicts one
- "Rechercher par touche": press a key combination and only the
commands using it are listed, however the key is spelled in the
user's language. A key also finds the two-key shortcuts it starts.
- "Copier la liste": the shown rows go on the clipboard as
tab-separated text with a header, so they paste into a spreadsheet
one cell per column
ShortcutManager::ShortcutInfo carries the icon and the first live
QAction so the page needs no second registry.
New test tst_shortcutspage covers the menu path, the columns, both
filters and the copied text.
Second stage of discussion #1319.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -137,6 +137,13 @@ QList<ShortcutManager::ShortcutInfo> ShortcutManager::allShortcuts() const
|
||||
info.description = entry.description;
|
||||
info.default_sequence = entry.default_sequence;
|
||||
info.current_sequence = savedSequence(id, entry.default_sequence);
|
||||
for (const QPointer<QObject> &target : entry.targets) {
|
||||
if (target) {
|
||||
info.icon = target->property("icon").value<QIcon>();
|
||||
info.action = qobject_cast<QAction *>(target.data());
|
||||
break;
|
||||
}
|
||||
}
|
||||
list << info;
|
||||
}
|
||||
return list;
|
||||
|
||||
Reference in New Issue
Block a user