Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Best practice associating event handlers with state changes

[Solved] Best practice associating event handlers with state changes

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 737 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sohail
    wrote on last edited by
    #1

    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.

    Thanks!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sohail
      wrote on last edited by
      #2

      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)}
      }
      @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved