Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one create a staggered grid view in QML?

Tags:

qt

qml

I am trying to create a staggered grid view for my QML application as shown in the image below. I have tried using QML Flow and QML Grid, however both of them don't result in the design I want.

enter image description here

For instance when I used QML Flow, it resulted in where the rows always start at the same Y value.

enter image description here

like image 528
Nik Avatar asked Oct 01 '14 23:10

Nik


1 Answers

I implemented a staggered grid view (what I call a ColumnFlow) for my app Project Dashboard, and have it in a separate library licensed under the GPLv3. Here is how it looks:

Project Dashboard - Pulse

The source code for ColumnFlow is in my GitHub repository iBeliever/ubuntu-ui-extras. The original implementation was started by another developer in a fork of my library, which I then pulled back in and made huge changes to get it to work the way I needed it to.

You can find various examples of how to use it in sonrisesoftware/project-dashboard, for example the Settings page.

like image 96
iBelieve Avatar answered Nov 15 '22 07:11

iBelieve