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. properly setting size of Flickable for ScrollBar

properly setting size of Flickable for ScrollBar

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 438 Views 1 Watching
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    I'm implementing a Flickable with ScrollBar. The ScrollBar doesn't reflect the actual size of the stuff in the Flickable - it just shows as completely visible. I think I'm doing something wrong with my size settings of the Flickable. Here's a minimal code snippet:

    ColumnLayout {
        anchors.fill: parent
    
        Flickable {
            id: flickable
            Layout.fillHeight: true
            Layout.fillWidth: true
            clip: true
            contentHeight: pumpStuff.height
    
            ColumnLayout {
                id: pumpStuff
                height: parent.height
                width: flickable.width - (scroller.width * 2)
    
                // lots of stuff here, not all of which shows up.
            }
            ScrollBar.vertical: ScrollBar {
                id: scroller
                policy: ScrollBar.AlwaysOn//AsNeeded
            }
        }
    }
    

    Can someone tell me what I'm doing wrong with this?

    Thanks...

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Imynn
      wrote on last edited by Imynn
      #2

      Hi! I am not sure, but I think your ColumnLayout doesn't need explicit height. It seems like your ColumnLayout is the same height as flickable, that's why scrollbar doesn't reflect actual size. So the possible solution could be removing height: parent.height and see if it works.

      mzimmersM 1 Reply Last reply
      1
      • I Imynn

        Hi! I am not sure, but I think your ColumnLayout doesn't need explicit height. It seems like your ColumnLayout is the same height as flickable, that's why scrollbar doesn't reflect actual size. So the possible solution could be removing height: parent.height and see if it works.

        mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        @Imynn that was it - I guess I'd been staring at it for so long, I'd overlooked the obvious.

        Thanks so much.

        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