PDA

View Full Version : QTreeView/Widget and decoration of them



carhun
13th July 2012, 08:04
Hello!

Can U give me some advice how to do like in attach file.

So I need to draw this rectangles with rounded edges?

As I understand I need to do some CSS and I need to use my implementation of QStyledDelegateItem to do that CSS applying only for first column?

Am I right?
Can U give me some examples of how to do this?

carhun.

wysota
15th July 2012, 10:54
The picture doesn't explain well what you want but if I guess correctly what your goal is then you should reimplement QTreeView::drawBranches() to provide your own branch drawing code. It's possible you'll have to reimplement drawRow() as well. An alternative is to reimplement drawTree() to draw custom background for items and then just call existing implementation of drawRow() (however the first approach should be simpler for you).