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

Initial positioning is broken for BottomToTop ListView wrapped in a ScrollView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.2
    • Quick: Other
    • None
    • RHEL 8.4
    • Linux/X11

    Description

      Almost the same example as in QTBUG-96678 but with positionViewAtBeginning() and equally sized delegates:

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          // Bare ListView (not wrapped in a ScrollView) shows up correctly
          ScrollView {
              anchors.fill: parent
              clip: true
      
              ListView {
                  id: lv
      
                  model: 1000
      
                  // TopToBottom lists get positioned correctly even when in ScrollView
                  verticalLayoutDirection: ListView.BottomToTop
                  delegate: Text {
                      width: lv.width
                      text: index
                  }
      
                  // The following line may be or may not be there, the effect is the same
      //            Component.onCompleted: positionViewAtBeginning()
              }
          }
      }
      

      Instead of a list view positioned at the beginning (i.e. at the bottom), I see a blank (scrollable) canvas with no signs of delegates first, with the vertical scroll bar all the way to the bottom and contentHeight seeming to match the content height of the list view as it should be. Scrolling it almost all the way up suddenly reveals bottom delegates (from 0 upwards, correctly ordered and drawn) and resets the vertical scroll bar back to the bottom, now reflecting the list view's actual whereabouts.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            alexey.rusakov Alexey Rusakov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes