Important: Please read the Qt Code of Conduct -

Qt5 keyPressEvent(...) not sent to main window

  • I wrote an application for my playbook using Qt 4.8.3 and was quite happy with the result. I did have numerous issues but was able to work through most of them.

    I tried using the latest version of Qt 5.0.1 and found a couple of items were broken. The main window (QMainWindow) no longer received the keyPressEvent(...) event which means that my menu (toolbar?) won't work. The other problem is likely related; the application uses a QGraphicsScene with proxy widgets and they don't accept any input either.

    The same application works fine in Qt4 but it doesn't accept input in Qt5.

    Has anyone run into this? Something in the events or an equivalent to the QInputContext for Qt5 maybe?

  • silly question; how do you send key events to a keyboard-less tablet?

  • I don' think it is a silly question.

    There is a keyboard that appears when input is required. From the applications point of view it doesn't matter if it is physical or simulated in software.

    You can have a software keyboard even on a desktop application. There is a Qt example of this using a subclass of QInputContext.

    Using a blackberry playbook, if you swipe from the top border into the application a key press event is (supposed) to be generated that is equivalent to pressing the 'Windows' key (Qt::Key_Menu,Qt::Key_Meta).

    If you cannot have a key press on a tablet then it is an expensive paper weight because you can't do anything else with it.

  • I went back and re-read the notes on building Qt for Blackberry.

    It does mention that it is targeting Blackberry 10 and not so much the playbook. It also recommends using 4.8.x

    From what I have found version 4.8.3 is the latest Qt version that you can use if your target is a playbook (version 2.1). Every version higher has some really strange issues (maybe unsolvable at the application level).

Log in to reply