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. How to make a grid with infinite scrollbar in Qml
Forum Updated to NodeBB v4.3 + New Features

How to make a grid with infinite scrollbar in Qml

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 997 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.
  • K Offline
    K Offline
    karenn1
    wrote on last edited by
    #1

    Hello friends,

    How to make a grid with infinite scrollbar in Qml?

    This is my code:
    Scrollbar.qml
    @Rectangle {
    id: scrollbar

    property real position: handle.y / (height - handle.height)
    
    width: 30
    radius: 5
    color: "#af3636"
    border.color: "#000000"
    
    Rectangle {
        id: handle
        width: scrollbar.width
        height: 25
        color: "#8d8c8c"
        radius: 3
        border.color: "#d9d8d8"
    
        MouseArea{
            anchors.fill: parent
            drag.target: handle
            drag.axis: Drag.YAxis
            drag.minimumY: 0
            drag.maximumY: scrollbar.height - handle.height
        }
    }
    

    }
    @

    Main.qml // I'm not sure if it's correct
    @ Rectangle {
    id: hallEditorFon
    x: 0; y: 0;
    width: parent.width - 260
    height: parent.height - 100
    color: "white"
    clip: true

        anchors.rightMargin: 30
    
        Scrollbar {
    
         id: scrollbar
    
    
         anchors.right: hallEditorFon.right
         anchors.bottom: parent.bottom
         anchors.top: parent.top
    
        }
    
        Grid {
            columns: 15
    
            Repeater {
                model: parent.columns * parent.columns
                Rectangle {
                    border.color: "#cfcfcf"
                    border.width: 1
    
                    color: "#000000ff"
                    width: 80; height: 80
                }
            }
    
        }
    
    
    }@
    

    Any help would be very appriciated,
    Karen

    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