Add API Command::initAction() to force create action for all commands
with shortcut in order to register with ShortcutManager to obtain a
complete list of actions with the same shortcut.
Support longest key sequence match with user defined delay (configurable
through 'Customize -> Keyboard -> Key sequence delay').
Support user defined priority to resolve shortcut conflict through
'Customize -> Keyboard')
Add 'All' category in 'Customize -> Keyboard' to list all command and
showing their shortcuts
Unify macro command shortcut setting (BaseApp/Preferences/Shortcut).
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto.
* When possible use a ranged for loop instead of begin() and end() iterators
When compiled in debug mode, this PR adds code to check for conflicting
accelerator keys when a command is created. This can help developers
ensure that their default accelerator key selections don't conflict.
Replace partial match algorithm
Co-authored-by: 0penBrain <48731257+0penBrain@users.noreply.github.com>
When the shortcut/accelerator key is changed, the tooltip should be
recalculated using the same code that calculated the original. Also
ensure this happens when the accelerator preferences are loaded.
Fixes#4664.
Improved tooltips showing:
- the command name as an <h3> title,
- the tooltip text,
- the (What's this).
the title is build from translated getMenuText() and can contain a "&" character. This commit search and remove the "&" characters. It should be better not to use the "&" character in the command name, but if it is necessary it has to be done with "&&".
ref forum discussion: https://forum.freecadweb.org/viewtopic.php?f=34&t=58747
.
QAction defaults menu role to TextHeuristicRole, which causes qt to
guess the menu role based on action title. And titles start with
'Config', 'Options', 'Settings', etc. will be considered as preference
menu. It seems some non-english translation causes the wrong action be
chosen as preference, such as 'Treeview actions'.
This commit just applied a temporary fix to default to QAction::NoRole
for GroupCommand. If there is ever some GroupCommand need to be a
system menu item on macos, we could add some command bit flag for that
purpose.
'QString& QString::vsprintf(const char*, __va_list_tag*)' is deprecated: Use vasprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
'QString& QString::sprintf(const char*, ...)' is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]