Results 1 to 4 of 4

Thread: Two-lined QlistItem

  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Question Two-lined QlistItem

    Hi !

    I am about to use a QListView to display some elements in my application. But I don't know where to seek for a "two-lined" qstandarditem to put in my list. Here is attached what I am looking for. I want the item to have text on 2 lines ad have different fonts on these two lines.

    With QItemDelegate ? Or is QListView not a good idea ?

    Thanks
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Two-lined QlistItem

    amarok is open source, so you can just look there how they did it. I would go for a custom delegate.

  3. #3
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Two-lined QlistItem

    I'll have a look but there are a lot of files in the amarok tarball...
    EDIT : Found it, it is called PrettyItemDelegate but I have no idea what to put in the paint() method (it is not editable), two qlabels ?

    Thanks
    Last edited by Guilo; 15th June 2010 at 15:08.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Two-lined QlistItem

    EDIT : Found it, it is called PrettyItemDelegate but I have no idea what to put in the paint() method (it is not editable), two qlabels ?
    2 Qlabels..nooo. You just need to drawText in 2 lines..

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.