Results 1 to 2 of 2

Thread: QML ListView ~ Multiple Columns

  1. #1
    Join Date
    May 2011
    Thanked 5 Times in 4 Posts
    Qt products
    MacOS X Unix/X11

    Default QML ListView ~ Multiple Columns

    I need to create a ListView with multiple columns. I've found a reference for creating a custom ListView delegate:

    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?

  2. #2
    Join Date
    Jan 2006
    Graz, Austria
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Unix/X11 Windows

    Default Re: QML ListView ~ Multiple Columns

    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.


  3. The following user says thank you to anda_skoa for this useful post:

    scgrant327 (16th March 2016)

Similar Threads

  1. qcombobox with multiple columns
    By seniorc in forum Newbie
    Replies: 1
    Last Post: 25th May 2014, 21:37
  2. QCombobox with multiple columns
    By grantbj74 in forum Qt Programming
    Replies: 4
    Last Post: 5th March 2014, 05:13
  3. multiple columns qtextdocument
    By xyfix in forum Newbie
    Replies: 0
    Last Post: 24th September 2009, 09:36
  4. ComboBox with multiple columns
    By haldrik in forum Qt Programming
    Replies: 7
    Last Post: 11th July 2009, 10:15
  5. QCheckListItem with multiple columns?
    By ecphora in forum Qt Programming
    Replies: 7
    Last Post: 12th April 2006, 05:01

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.