Open letsfindaway opened 2 months ago
This looks like a good solution for the warnings. I find the code more readable now too.
if (action->property("builtIn").toBool())
{
for (const QKeySequence& shortcut : action->shortcuts())
{
shortcuts << shortcut;
}
}
https://github.com/OpenBoard-org/OpenBoard/blob/dev/src/core/UBShortcutManager.cpp#L599-L605
Not directly related, but why aren't there ctrlShortcuts
added? Are builtIns guaranteed to never have a CTRL? Though it's never checked anywhere else.
I'd expect the QKeySequence(shortcut ^ Qt::CTRL)
that's in the other lines, even if it might not actually do anything useful.
Not directly related, but why aren't there
ctrlShortcuts
added? Are builtIns guaranteed to never have a CTRL? Though it's never checked anywhere else. I'd expect theQKeySequence(shortcut ^ Qt::CTRL)
that's in the other lines, even if it might not actually do anything useful.
The buildin
s are those which are not defined as action shortcuts but are interpreted from key press events. Here the ignore Ctrl
feature is not and cannot be applied. Therefore they are not added to the ctrlShortcuts
because they are not affected by the ignoreCtrl
flag.
This PR is an attempt to fix #1077. See there for a discussion of the problem.