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

Change TableView pointerNavigationEnabled to selection flags

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Quick: Controls 2
    • None

    Description

      I was recently using TableView, together with QML ItemSelectionModel and TapHandler inside the delegates. I found it very weird, that per default (without doing anything in the tapHandler other than putting it in the delegate) clicking on delegates updated the current index (good) and cleared the existing selection in the table (bad).
      I find the idea behind such a bool which automatically works together with input handlers in delegates awesome, but I would like to be able to modify the behavior - the latter would make this feature a lot more useful. For example making the pointerNavigation bool into a flags int for Selection flags of the ItemSelectionModel would be awesome (with a default of Clear | Current to maintain the current behavior).

      Some cool stuff  one could implement with this:

       - Use it in tables where selecting one cell of a row implicitly selects the entire row (By setting the pointerNavigation flags to Clear | Select | Rows) and same ofcourse for column selection.
       - Use it in toggle selection tables (where I could make a binding to PointerNavigationFlags and set Toggle if e.g. shift is pressed (with my own logic to figure out when that is the case))

       - Or not use it at all (should have a None or Disabled option) and do my own stuff in the delegate tapHandlers/table-wide handlers

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            r.vitanov Rosen Vitanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes