unity-api-bugs team mailing list archive
-
unity-api-bugs team
-
Mailing list archive
-
Message #07610
[Bug 1380702] Re: No keyboards shortcuts in QT apps
Investigating this bug in-between release tasks. I'm starting to think
we might not be able to fix this without modifying Qt5 in the end.
Looking at Qt5 QShortcut code, there even is a very specific 'hack' to
enable shortcuts for MacOSX systems that also have a global menu. The
shortcut map is being passed a contextMatcher, and one of the first
checks in the context matcher is the check if the owning widget is
visible or not. In the case of the usage of platform menu bars, as
mentioned in comment #6, the source QMenuBar is hidden. In other words,
at that place the shortcut is basically not considered when the widget
is not visible. So how does OSX still have shortcuts working? By an ugly
ifdef in the Qt code:
bool visible = w->isVisible();
#ifdef Q_OS_MAC
if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
visible = true;
#endif
if (!visible || !w->isEnabled())
return false;
So basically OSX is a 'special case' here. I hate ifdefs... this should
really be some configurable option, or even better - some option you can
define in the QPlatformTheme or QPlatformMenu* objects.
--
You received this bug notification because you are a member of Unity API
bugs, which is subscribed to sni-qt.
https://bugs.launchpad.net/bugs/1380702
Title:
No keyboards shortcuts in QT apps
Status in appmenu-qt5:
In Progress
Status in Canonical System Image:
Confirmed
Status in sni-qt:
New
Status in Ubuntu:
Confirmed
Bug description:
In some apps built using QT4 & 5, menu shortcuts are greyed out and
inoperant. Only alt and FKeys-based shortcuts work. Others, notably
ctrl+c for copying, do not.
This is quite serious ; mail me for more details.
To manage notifications about this bug go to:
https://bugs.launchpad.net/appmenu-qt5/+bug/1380702/+subscriptions