[PyQt] keyPressEvent differences Qt4-Qt5 in Mac OS?
davecortesi at gmail.com
Fri Apr 4 14:49:59 BST 2014
In upgrading an app from Qt4 to Qt5 I have found what appears to be an
incompatibility between releases on Mac OS X.
The app intercepts keystrokes using a keyPressEvent method. In Qt4, when
the user presses the Mac keys Option and 3, the keyEvent contains a
modifier of Qt.Alt_Modifier and a key of Qt.Key_3 (0x33)
In Qt5, the modifier is the same, but the key is Qt.Key_sterling (0xa3).
Other Option-keys deliver, not the physical key code, but the special
characters shown in the Mac OS Keyboard Viewer widget. For example Option-7
delivers Qt.Key_paragraph instead of Key_7.
This could be seen as a feature for the Mac user, but it is a sharp
incompatibility between releases, and between platforms. It is not
mentioned in the PyQt5 diffs  or in the Qt5 transition doc . I've
looked through the docs for QCoreApplication, QGuiApplication and
QApplication hoping for some kind of switch but don't see it.
I think this is probably in Qt5, but thought I'd ask if it could possibly
lie in PyQt5, or be circumvented in PyQt5.
Thanks for your attention,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt