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

Setting ListView.snapMode to ListView.SnapOneItem breaks behaviour of ListView.StrictlyEnforceRange when inserting an item at the current index

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.3.0
    • None

    Description

      Warning: this is a quite specific situation where all the parameters set matter.

      By default when inserting an item at index 'ListView.currentIndex', a ListView with highlightRangeMode: ListView.StrictlyEnforceRange will move the items to position the newly introduced one at the beginning.

      When additionally setting ListView.snapMode to ListView.SnapOneItem, that behaviour is changed and the items do not move anylonger upon insertion even though the currentIndex is still adequately updated.

      Setting the currentIndex manually after that leads to the view animating to the desired index but by first instantly moving the viewport to the position it should have been in if snapMode had not been breaking the behaviour.

      See attached example program. Try it with and without snapMode set and observe the visual difference.

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            kaleo Florian Boucault
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes