Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ScrollView does not correctly scroll a ListView
QtWS25 Last Chance

ScrollView does not correctly scroll a ListView

Scheduled Pinned Locked Moved QML and Qt Quick
qmlscrollviewlistviewbottomtotop
1 Posts 1 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TobiasT Offline
    TobiasT Offline
    Tobias
    wrote on last edited by Tobias
    #1

    Hi,

    I have the a problem when embedding a ListView into a ScrollView.
    And the ListView has verticalLayoutDirection: ListView.BottomToTop set.

    The ScrollView shows a scrollbar even if the shown list is to short to be scrolled at all.
    Scrolling a short list jumps the list to the top, but is should be displayed at the bottom.
    Resizing the ScrollView makes the list jump back to the bottom where it belongs.

    Here is my example:

    import QtQuick 2.4
    import QtQuick.Controls 1.3
    import QtQuick.Layouts 1.1
    
    Rectangle {
        id: root
        width: 200
        height: 200
        visible: true
    
        ScrollView{
            anchors.fill: parent
            frameVisible: true
            verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
            horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
    
            ListView{
                model: 10
                boundsBehavior: Flickable.StopAtBounds
                verticalLayoutDirection: ListView.BottomToTop
    
                delegate: Text{
                    text: "This is item " + index
                }
            }
        }
    }
    
    

    I'm using Qt 5.4.1 and the problem was encountered using VS2013 and also Qt Creator 3.3.1(MinGW 32Bit) so it doesn't seam to be compiler related problem.

    Any one knows a fix to this. Or can at least confirm that this is happening so I can hand in a bug report.

    Cheers
    Tobi

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved