- It seems that on MacOS (vs other platforms), shortcuts for items in
the application menu are given 'ultimate' priority, and will even take
precedence over text inputs
- There is a mechanism in QT (I believe designed with mac in mind) to
try to 'block' these shortcuts and send it to the focus instead. It's
'Shortcut Override': https://wiki.qt.io/ShortcutOverride
- Initially I was going to only apply this check when it's a Command
that overrides a known line-editing shortcut, but I figure it's
simpler to just always apply it when editing text. I can't really
imagine a user wanting to use an application shortcut while editing
text, but if there's some compelling use-case for this then let me know
and I'll add a further filter.
I'm quite optimistic that this won't have any ill-effects on other
platforms, but I'll need help from others to test this.
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
This adds isNullOrEmpty string helper that cheks if string is... well
null or empty. It is done to improve readability of the code and better
express intent.
* QString::indexOf() is now marked as [[nodiscard]]
* QApplication::fontMetrics() is deprecated, use the constructor of QFontMetricsF
* fix -Wunused-result
* fix -Wunused-but-set-variable
Related #6097
Qt ignores shortcut of actions in invisible toolbar, but not for actions
in a hidden menu action of menu bar, which is likely a Qt bug. The
desired behavior should be that of toolbar actions, so that actions
belong to different workbenches can have the same shortcut without
conflict.
This commit works around this inconsistency by ensuring only the active
actions are added in menu bar. In addition, all active actions will be
added to a zero sized child widget of the main window, which ensures the
shortcuts of these actions being active regardless whether the action is
in toolbar or menu bar, visible or not.
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).