PDA

View Full Version : QTreeView: Getting the Child Indicator to align to the top of the item



ChiliPalmer
10th September 2012, 13:41
Hi,

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

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

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:
8207

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

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.

ChiliPalmer
14th September 2012, 17:06
I still don't have a solution, so *bump*