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

highlightFollowsCurrentItem: false (ListView and GreedView) seems buggy

    XMLWordPrintable

Details

    Description

      import QtQuick 2.7
      import QtQuick.Controls 2.0
      Item {
          id: root
          width: 200
          height: 700
      
          ListView {
              id: list
              clip: true
              spacing: 10
              model: 100
              width: 100
              height: 500
              highlightFollowsCurrentItem : false
              //highlightRangeMode:
              delegate: Rectangle {
                  width: 100
                  height: 100
                  color: "green"
                  opacity: ListView.isCurrentItem ? 1 : 0.5
                  Text {
                      anchors.centerIn: parent
                      text: index
                      font.pixelSize: 20
                  }
              }
          }
      
          Button {
              anchors.top: list.bottom
              width: 100
              height: 100
              text: list.currentIndex
              onClicked: list.currentIndex = ++list.currentIndex % list.count
          }
      }
      

      Preconditions:
      Scroll the list so that the current item was before visible items.
      Steps:
      Click on button (change current index)
      Observed result:
      highlightRangeMode = ListView.ApplyRange: the Listview scrolls to the beginning
      highlightRangeMode = ListView.StrictlyEnforceRange: unable to execute (the current item can't be before visible items.)
      highlightRangeMode = ListView.NoHighlightRang: the Listview scrolls so that the current item becomes visible

      If the current item is visible, or it is after visible items, then the ListView will not scrolled, when the current index changed (independently of highlightRangeMode).
      Is it possible to make behavior independent of the position of the current item?

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            evkol Evgeny
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes