Results 1 to 2 of 2

Thread: QTreeView: how to draw root decoration but no further indents

  1. #1
    Join Date
    Apr 2006
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeView: how to draw root decoration but no further indents

    I'm using stylesheets, too, if there's a way with that.. basically what I want is to have the root level indent and show the little +, - icons, but the next level no further indented (the tree only has one level).

    setIndentation( 0 ) almost works but the root decorations don't show up
    setRootIsDecorated( False) is like the opposite of what I want

    Any ideas?

    thanks,
    joel

  2. #2
    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: QTreeView: how to draw root decoration but no further indents

    I guess delegates will be the way to go.
    You will need to set the rects properly and call the base class drawings..
    You can also override drawChecks in QItemDelegate class

Similar Threads

  1. Custom Window Decoration?
    By BadKnees in forum Qt Programming
    Replies: 5
    Last Post: 28th April 2011, 18:49
  2. QTreeWidgetItem decoration
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2009, 15:01
  3. Direct root childs inline QTreeView
    By faraslacks in forum Qt Programming
    Replies: 2
    Last Post: 15th January 2009, 07:45
  4. QTreeView: make root decoration appear on visual column 0
    By chezifresh in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2008, 02:36
  5. Mdi Window decoration
    By kalpa in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2007, 09:19

Tags for this Thread

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.