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

TableView extended selection cleared when selecting a range with keyboard outside of valid range

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • Some future release
    • 5.2.1
    • Quick: Controls 1
    • None
    • * Qt 5.2.1 (QtQuick Controls 1.1)
      * Ubuntu 13.10 64bit

    Description

      When you select a range of rows in a TableView with the keyboard, you do so by pressing shift+down or shift+up. When the bottom or top is reached but you keep pressing the key, the selection is cleared.

      Example code

      A simple TableView setup already shows the issue:

      tableview-test.qml
      import QtQuick 2.2                          
      import QtQuick.Controls 1.1 
      
      TableView {
          width: 300 
          height: 300 
          focus: true
      
          model: [{text:'foo'}, {text:'bar'}, {text:'baz'}, {text:'meow'}]
      
          selectionMode: SelectionMode.ExtendedSelection
      
          TableViewColumn {
              width: 200 
              role: 'text'
              title: 'Text'
          }   
      }
      

      User input

      The following two scenarios result in the same behavior.

      • Select any row. Keep pressing shift+down, until you extended the selection to the last row. Then press shift+down again.
      • Select any row. Keep pressing shift+up, until you extended the selection to the first row. Then press shift+up again.

      Issue / Actual Behavior

      • The selection is cleared as soon as the user navigates outside of the valid range.

      Expected Behavior

      • Nothing should happen (the selection should stay the same) when the user navigates outside of the valid range with shift being held down.
      • Without shift, the last (first) row should be selected exclusively.

      Notes

      When the user presses the up (down) key after the first (second) scenario, the second last (second) row is selected; as if the last (first) row was still the current index, but not selected. This makes me believe that there is not a range check missing but rather the reaction to a failed range check is wrong (clear instead of no-op).

      Possibly related: https://bugreports.qt-project.org/browse/QTBUG-38270

      Attachments

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

        Activity

          People

            bachewii Jens
            leemes Sebastian Lehmann
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes