Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved ScrollView.verticalScrollBarPolicy not working on Qt 5.4?

    QML and Qt Quick
    2
    2
    631
    Loading More Posts
    • 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.
    • A
      Archie888 last edited by Archie888

      Hi, I am trying to keep the vertical scrollbar always on the screen in my ScrollView for clarity. I was hoping that the property verticalScrollBarPolicy with the value Qt.ScrollBarAlwaysOn could accomplish this. I'm afraid the result is the same as with Qt.ScrollBarAsNeeded: the scroll bar will appear only when doing some flicking action on the view, with which I mean using the mouse scroll or a touch pad for instance on desktop.

      I am using Qt 5.4.

      Any tips, other than installing latest Qt? Is this a bug?

      Thanks,
      -A888

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Archie888 last edited by

        Hi! This works for me with Qt 5.6.0:

        import QtQuick 2.5
        import QtQuick.Window 2.2
        import QtQuick.Controls 1.4
        
        Window {
            visible: true
            width: 1000
            height: 600
        
            ScrollView {
                anchors.fill: parent
                verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
                Image { source: "file:///home/pw/img.jpg" }
            }
        
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post