Results 1 to 2 of 2

Thread: Problem while using setItemWidget in QTreeWidget.

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Problem while using setItemWidget in QTreeWidget.

    Hi,

    To use rich text in QTreeWidget i used setItemWidget to insert QLabel but items disappears after scrolling up and down.

    Screen shot 2014-02-19 at 3.46.47 PM.png

    I even tried to use QTextDocument and QTextEdit instead of QLabel but same problem persists.
    Always Believe in Urself
    Merry

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

    Default Re: Problem while using setItemWidget in QTreeWidget.

    You might have to go for an item delegate, so you can customize painting of the cell in that particular column.
    QTextDocument can render the text for you, but the delegate needs to set up the painter, etc.

    Cheers,
    _

Similar Threads

  1. setItemWidget in QWidgetList does not work
    By Quabla in forum Newbie
    Replies: 3
    Last Post: 15th March 2013, 06:10
  2. Do I need to destroy the widget of setItemWidget?
    By qlands in forum Qt Programming
    Replies: 2
    Last Post: 30th May 2011, 14:24
  3. Replies: 4
    Last Post: 8th April 2011, 20:59
  4. Replies: 0
    Last Post: 29th November 2010, 05:34
  5. Replies: 7
    Last Post: 19th October 2010, 08:32

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.