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.verticalScrollBarPolicy not working on Qt 5.4?
QtWS25 Last Chance

ScrollView.verticalScrollBarPolicy not working on Qt 5.4?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 748 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.
  • A Offline
    A Offline
    Archie888
    wrote on last edited by Archie888
    #1

    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
    0
    • A 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

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      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
      0

      • Login

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