PDA

View Full Version : QML ListView ~ Multiple Columns



scgrant327
16th March 2016, 14:05
I need to create a ListView with multiple columns. I've found a reference for creating a custom ListView delegate:

http://kunalmaemo.blogspot.com/2011/03/creating-custom-listview-delegate-in.html

But, my question is... Say I want 4 columns laid out like this:

Col 1 has an icon
Col 2 has two text fields stacked ontop of each other
Col 3 has two text fields stacked ontop of each other
Col 4 has an icon

How would I go about laying this out? I understand I'll have to create a custom delegate... I assume I'll create a 'template' delegate that I'll instantiate and append to the ListView?

anda_skoa
16th March 2016, 14:11
You always have a custom delegate, that is how the ListView works.
You just need four appropriately wide items in a row or anchored horizontally and then fill these "cells" with whatever child items you need.

Or you use a TableView.

Cheers,
_