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

Shift+click to extend selection in QListView does not detect initial selection correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11.2
    • Core: Item Models
    • None
    • macOS 10.13.6
    • macOS, Windows

    Description

      If you use the select function on a QAbstractItemView's SelectionModel in order to programmatically set an initial selection on e.g. a QListView, this item appears to be selected when the control is shown.

      However, if you then hold Shift and click on another item in the list, you will find that all of the items in the list become selected rather than only the range between the programmatically selected item and the item you clicked on.

      The attached trivial test application demonstrates this problem.

      1. Open QListViewSelectionTest.pro in Qt Creator.
      2. Build and run it.
      3. When it runs, "Item 4" is selected in the list view.
      4. Without clicking elsewhere in the list view, hold Shift and click on e.g. "Item 6".

      EXPECTED: "Item 4", "Item 5" and "Item 6" are selected.
      ACTUAL: All items in the list are selected.

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            dspreadbury Daniel Spreadbury
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes