Results 1 to 2 of 2

Thread: QML ListView ~ Multiple Columns

  1. #1
    Join Date
    May 2011
    Posts
    77
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    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:

    http://kunalmaemo.blogspot.com/2011/...legate-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?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    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.

    Cheers,
    _

  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, 22:37
  2. QCombobox with multiple columns
    By grantbj74 in forum Qt Programming
    Replies: 4
    Last Post: 5th March 2014, 06:13
  3. multiple columns qtextdocument
    By xyfix in forum Newbie
    Replies: 0
    Last Post: 24th September 2009, 10:36
  4. ComboBox with multiple columns
    By haldrik in forum Qt Programming
    Replies: 7
    Last Post: 11th July 2009, 11:15
  5. QCheckListItem with multiple columns?
    By ecphora in forum Qt Programming
    Replies: 7
    Last Post: 12th April 2006, 06:01

Tags for this Thread

Bookmarks

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.