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

Custom highlight disappears when ListView::highlightFollowsCurrentItem is false

    XMLWordPrintable

Details

    • 972134e16767d1ea5224fba911c894eb22b70ca4

    Description

      This is taken from the example in the ListView docs for highlightFollowsCurrentItem, with model added:

       import Qt 4.7
      
       Item {
      
          ListModel {
              id: model
               ListElement {
                   name: "Bill Smith"
                   number: "555 3264"
               }
               ListElement {
                   name: "John Brown"
                   number: "555 8426"
               }
               ListElement {
                   name: "Sam Wise"
                   number: "555 0473"
               }
           }
      
           Component {
               id: highlight
               Rectangle {
                   width: 180; height: 40
                   color: "lightsteelblue"; radius: 5
                   SpringFollow on y {
                       to: list.currentItem.y
                       spring: 3
                       damping: 0.2
                   }
               }
           }
      
           ListView {
               id: list
               width: 180; height: 200
               model: model
               delegate: Text { text: name }
      
               highlight: highlight
               highlightFollowsCurrentItem: false
               focus: true
           }
      
      }
      

      When this is run, the highlight can be seen briefly as it shoots upwards and over the top of the items.

      This occurs regardless of whether the SpringFollow is present. I just included that because it was in the example code.

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes