(fix) Waveform viewer: reject focus on click, allow global keyboard shortcuts #13173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #13160 for waveforms and spinnies, already noticed in the waveforms PR #10989 (comment)
Focus is still removed from the current focus widget, but cleared right away so keyboard shortcuts still work.
Obviously, it'd be better not to move focus in the first place, but I didn't manage to prevent that.
Previously I tried with eventFilter in OpenGLWindow but that didn't work for some reason.
Also, only rejecting the FocusIn event is not sufficient, even though the child widget has the Qt::NoFocus policy, so it shouldn't accept focus in the first place 🤷♂️
edit I'm experiencing inconsitent behaviour: doing another test (since I'm not happy with this hack) it turns out that rejecting the FocusIn is sufficient.
However, I'd still prefer to not focus the QOpenGLWindow in the first place.
@m0dB What do you think?