Results 1 to 4 of 4

Thread: questions on QListView

  1. #1
    Join Date
    Apr 2007
    Posts
    46
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default questions on QListView

    I want a listview that shows
    a red separator between logical groups in the listview (i.e. only between certain records).
    Can you give me direction what functions to use/reimplement for this?
    [my other question--that I edited out--was about word wrapping]
    Last edited by ber_44; 25th July 2007 at 09:05.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: questions on QListView

    Use a QListView and create your own item delegate.
    Also, you should have two types of items: normal and section separators.

    You should differentiate between items with roles.

    The delegate will paint a section separator as a red line, while the delegate will paint a normal item as you require it: with word wrap, etc. Just be careful to set the correct size hints.

    Regards

  3. #3
    Join Date
    Apr 2007
    Posts
    46
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: questions on QListView

    I just realized that there was a similar discussion:
    http://www.qtcentre.org/forum/f-qt-p...wrap-7278.html
    Thanks for the hint.

  4. #4
    Join Date
    Apr 2007
    Posts
    46
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: questions on QListView

    I did try using this:
    http://www.qtcentre.org/forum/f-qt-p...#td_post_38948
    But see the results attached. Any ideas? I'm using Mac right now.
    Attached Files Attached Files

Similar Threads

  1. QListView word wrap
    By serega in forum Qt Programming
    Replies: 17
    Last Post: 30th August 2007, 03:13
  2. QDialog / QListView problem
    By harakiri in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 18:31
  3. Subclass QListView to show two colums in one
    By Mookie in forum Qt Programming
    Replies: 2
    Last Post: 23rd June 2007, 02:12
  4. Memory management questions (im new to Qt)
    By scarvenger in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2007, 07:41
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 14:45

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.