Results 1 to 2 of 2

Thread: QTreeView: Getting the Child Indicator to align to the top of the item

  1. #1
    Join Date
    Sep 2009
    Location
    Aachen, Germany
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeView: Getting the Child Indicator to align to the top of the item

    Hi,

    I have an Item Delegate that customizes the look of the Items in a QTreeWidget, like this:
    1.jpg

    I recently added that if you click one of the items, it will expand and show additional information, like this:
    2.jpg

    I expand the item by increasing the height returned by my delegates sizeHint.

    My problem is, that, as you can already see in the second image, the child indicator moves downward to the vertical center of the item.
    That is a problem when a child item has children itself.

    Here the item "LKW" is expanded and the current item, you can see its additional information and its children:
    3.jpg

    Here the item is closed and the current item, you can see its additional information, but the child indicator is hidden behind it:
    3.jpg

    I intentionally make the additonal information box that wide, so just limiting it to the size of the item isn't a solution.

    Is there any way I can get the child indicator to be drawn at the top of the item?
    I tried it via my delegate, but that doesn't really work, and the drawBranch method of QTreeView is just too complex, I don't really want to reimplement that.

  2. #2
    Join Date
    Sep 2009
    Location
    Aachen, Germany
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeView: Getting the Child Indicator to align to the top of the item

    I still don't have a solution, so *bump*

Similar Threads

  1. Replies: 1
    Last Post: 16th August 2012, 04:15
  2. QTreeView branch indicator bug?
    By ugluk in forum Qt Programming
    Replies: 2
    Last Post: 28th May 2012, 10:55
  3. QTreeView draw drop indicator
    By mentalmushroom in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2011, 09:05
  4. QTreeView different item delegate for child items possible?
    By Royceybaby in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2010, 21:14
  5. Drop indicator not displaying with QTreeView. Need help
    By bigchiller in forum Qt Programming
    Replies: 12
    Last Post: 12th March 2008, 11:38

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.