Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll QML Grid

Tags:

scroll

grid

qt

qml

I want to make my QML Grid scrollable as soon as the content is too long for it to display.

Grid {
     objectName: "sidebarView"
     id: sidebarGrid
     flow: Grid.TopToBottom
     columns: 1
     spacing: 10
}

Is that possible with just a few properties added to the Grid?

like image 533
alex Avatar asked Jan 17 '12 15:01

alex


1 Answers

No, but you can just put a Flickable around the Grid

Flickable {
    anchors.fill: parent
    contentHeight: sidebarGrid.height
    contentWidth: sidebarGrid.width

    Grid {
         objectName: "sidebarView"
         id: sidebarGrid
         flow: Grid.TopToBottom
         columns: 1
         spacing: 10
    }
}
like image 192
blakharaz Avatar answered Oct 11 '22 06:10

blakharaz