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

listview: insert at first visible element should not result in auto scrolling

XMLWordPrintable

      if the first visual item is the second element in model (whose index is 1), insert new element at position 0 will not affect visual items.

       

      but if the first visual item is the first element in model, same operation will result in auto scrolling down. (the number of elements in model is enough more than one screen to display)

       

      after check the code, (I don't know if I had found the right position):

      file: qtdeclarative/src/quick/items/qquicklistview.cpp
      function: bool QQuickListViewPrivate::applyInsertionChange

      sentence:  if (insertResult->visiblePos.isValid() && pos < insertResult->visiblePos) {

      does the "pos < insertResult->visiblePos" should be "pos <= insertResult->visiblePos" ???

        1. insertAtFirstVisibleItem.patch
          1 kB
          niqingliang2003
        2. main.qml
          1 kB
          niqingliang2003
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            iamsergio Sergio Martins
            niqingliang2003 niqingliang2003
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes