keyPressEvent not being called
-
Main window has a keyPressEvent handler and sets "strong focus" policy in order to intercept F1 on Windows/Unix or Command-? on MacOS
The main window has a two Dock windows. If they are docked then F1 is passed up the child/parent chain to the main window and the main window keyPressEvent is driven and the help is displayed.
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
-
Main window has a keyPressEvent handler and sets "strong focus" policy in order to intercept F1 on Windows/Unix or Command-? on MacOS
The main window has a two Dock windows. If they are docked then F1 is passed up the child/parent chain to the main window and the main window keyPressEvent is driven and the help is displayed.
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
@Perdrix said in keyPressEvent not being called:
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
Because main window hasn't the focus.
You may try a global QShortcut with context set to Qt::ApplicationShortcut -
Main window has a keyPressEvent handler and sets "strong focus" policy in order to intercept F1 on Windows/Unix or Command-? on MacOS
The main window has a two Dock windows. If they are docked then F1 is passed up the child/parent chain to the main window and the main window keyPressEvent is driven and the help is displayed.
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
@Perdrix said in keyPressEvent not being called:
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
Playing with undocked
QDockWidgetsandfocus()seems to be a weird thing. There are a lot of partly/not resolved topics dealing with this here and on StackO...
It also seems to be platform dependent and every OS treats the undocked windows/widgets slightly different. -
Main window has a keyPressEvent handler and sets "strong focus" policy in order to intercept F1 on Windows/Unix or Command-? on MacOS
The main window has a two Dock windows. If they are docked then F1 is passed up the child/parent chain to the main window and the main window keyPressEvent is driven and the help is displayed.
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
@Perdrix said in keyPressEvent not being called:
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
Because main window hasn't the focus.
You may try a global QShortcut with context set to Qt::ApplicationShortcut -
@Perdrix said in keyPressEvent not being called:
When they are un-docked and have focus, when I press F1, then the main window's keyPressEvent() isn't called.
Because main window hasn't the focus.
You may try a global QShortcut with context set to Qt::ApplicationShortcut -
P Perdrix has marked this topic as solved on