[Solved] Best practice associating event handlers with state changes

  • Hi,

    Given the bug here: https://bugreports.qt-project.org/browse/QTBUG-27300 - what would be the "best practice" associating specific handlers with state? If you were implementing a vi-like keyboard interface, it seems superior to use a state machine but in the face of this bug, it is impossible.

    The alternatives I see are not very appealing.


  • The only workaround I've found so far is:

    Keys.onPressed: keyHandler(event)
    property var keyHandler: function(event){}
    ... PropertyChanges {
    target: whatever
    keyHandler: function(event){console.log(event.text)}

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.