Results 1 to 3 of 3

Thread: paint QTreeView item !!

  1. #1
    Join Date
    Mar 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X

    Default paint QTreeView item !!

    I create a QTreeView and I set my custom model and my custom delegate. In my delegate I redefine the paint method to paint the items of the QTreeView like I want. The issue is that the branches are not paint (I have attached a picture of the QTreeView).
    So how can I do to paint the item and the branch using my delegate ? I'd like to avoid to subclass QTreeView and redefine the drawBranches method ....
    Thanks for your help!
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: paint QTreeView item !!

    The delegate is not responsible dor painting branches. You can enable or disable branches painting by tweaking the tree view or by changing the QStyle of the application.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: paint QTreeView item !!

    This thread might be worth checking out..

Similar Threads

  1. QTreeView and item editing
    By roxton in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:56
  2. QTreeView, QSortFilterProxyModel and item expansions
    By benacler in forum Qt Programming
    Replies: 3
    Last Post: 21st May 2008, 20:30
  3. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 07:37
  4. QTreeView: selection behavior upon selected item removal
    By Pieter from Belgium in forum Qt Programming
    Replies: 6
    Last Post: 11th July 2007, 16:00
  5. Programattically Clicking an Item in QTreeView
    By johnny_sparx in forum Qt Programming
    Replies: 4
    Last Post: 11th May 2006, 16:26

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.