Congratulations to our 2022 Qt Champions!

Prevent list from capturing keys

  • Hello
    I'm developing a software which UI the user navigates using only the keyboard. I've implemented the:

    @keyPressEvent(QKeyEvent *e)@

    This works fine, until a layout with a list on it is opened. My problem is that the list captures the key presses.
    How can I prevent this? Do I have to make a new list object and re implement the key press function?
    Or is there a better way? Thank you!
    Best regards

  • Can you take away the focus from the list and give it to the component that is going to filter it?

  • Stupid question, but how can I remove the focus from the list without adding another element that has a focus property? I'd like to send the keypresses to the layout object. I've tried to debug by clicking the layout widget itself, but apparently the focus stays locked to the list (responds to arrow up/down).

    • Richard

Log in to reply