Results 1 to 3 of 3

Thread: QTreeView Custom column with an icon, and 2 lines of text

  1. #1

    Default QTreeView Custom column with an icon, and 2 lines of text

    Hi guys, What do you think would be the best way to go from a standard QTreeView widget like the first on the image to the second one?



    I was thinking of embedding a TextBrowser or a rich text control, in each cell with a QStyledItemDelegate.

    The model is really simple, just plain directories or files.

  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: QTreeView Custom column with an icon, and 2 lines of text

    Just write your own delegate and paint the icon and the two text lines. A text browser for that would be a pure overkill!

  3. #3

    Default Re: QTreeView Custom column with an icon, and 2 lines of text

    You are right, i'm going that way, I didn't know how simple it was.

Similar Threads

  1. Custom ListWidget(QCheckBox + Icon + Text)
    By nrabara in forum Newbie
    Replies: 6
    Last Post: 13th May 2010, 07:35
  2. Differentiate the icon and text in a QTreeView column
    By gmat4321 in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2009, 16:38
  3. Replies: 4
    Last Post: 25th May 2008, 21:01
  4. [QT4] QTreeView and rows with multiple lines
    By KShots in forum Qt Programming
    Replies: 8
    Last Post: 30th March 2006, 19:47
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 16:51

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.