ID 381977 - Qt 5: KeyPress events are not received by KatanaApplication when Shortcut events are triggered

Follow

Problem summary:

It seems that the behaviour in Qt 5 has changed, and KeyPress events are no longer sent to the application when a Shortcut event has been fired. KeyRelease events are still received just after the Shortcut event.
 
Katana 3.0 Katana 3.1
  1. KeyPress event
  2. Shortcut event
  3. KeyRelease event
  1. Shortcut event
  2. KeyRelease event

Steps to reproduce:

  • Edit your shortcuts.xml to assign the N key to any of the Scene Graph tab actions. For example:

<shortcuts>    <shortcut id="a982394e86e62142a3982addbac822d5" name="SceneGraphView.ExpandBranches" shortcut="N"></shortcut></shortcuts>
  • Launch Katana.
  • (Optional) Run the following in a Python tab, so you can monitor what widget has the focus at any time:

def focusChanged(oldWidget, nowWidget):    print("-----------------------------------> " + str(nowWidget))QtWidgets.QApplication.instance().focusChanged.connect(focusChanged)
  • Click on the Scene Graph tab, to set the focus to the TreeWidgetViewLink.TreeWidget widget.
  • Move the mouse pointer over the Node Graph tab.
  • Press N.
  • Expected:
    • Context menu should appear.
  • Actual:
    • The context menu won't appear, as no KeyPress event has been fired.

NOTE: A developer could add some logging to KatanaApplication::notify() to confirm that indeed the KeyPress event is not received by the application in this case.

Tested versions/platforms:

  • 3.0v6 - Unaffected
  • 3.0v7 - Unaffected
  • 3.1v1 - Affected
  • 3.1v2 - Affected

    We're sorry to hear that

    Please tell us why