Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-17051

Allow disabling of Mouse Interaction with ListView (Flickables?) while still retaining keyboard interaction

    XMLWordPrintable

Details

    • d1fbfbbab7f78e0a1050acce3540c02660a0d68f 52954268e9202e33eb8c2db93a51d55a2596051b

    Description

      I have a use case where I would like to use a ListView in my QML UI, however need to disable all mouse interaction with our application and use keyboard only input. The mouse "device" is still active, however (by which I mean the system has a mouse interface that can still be used to select things).

      Setting the "interactive" property of the ListView to false also disables the ListView's own handling of keyboard events in addition to the Mouse events, which is not my desired outcome.

      I have tried a workaround where I add a child MouseArea to the ListView and have a handler for onPressed where I simply set the accepted property of the mouse event to true, however this had no effect.

      Currently to achieve the above I have to have my own handlers for the keyboard (e.g. Keys.onDownPressed) and manually change the currentItem property of the ListView.

      Maybe a new property could be added, or the "interactive" property of a flickable could have some enum dictating the following:

      Mouse+Keyboard input accepted (default)
      Only Mouse events dealt with
      Only Keyboard events dealt with
      No events dealt with at all.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mitch_curtis Mitch Curtis
            thatbloke Mark Tucker
            Votes:
            15 Vote for this issue
            Watchers:
            22 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes