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

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.2
    • Fix Version/s: None
    • Component/s: Core: Item Models
    • Labels:
      None
    • Environment:
      macOS 10.13.6
    • Platform/s:
      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

            Assignee:
            dfaure_kdab David Faure
            Reporter:
            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