PDA

View Full Version : Customizing QTreeview/QTreeWidget



ommharidaas
12th January 2012, 06:08
Hi All,
I am looking to customize the QTreeWidget in way that the arrows pointing to the branching can be shown on right side.
Thought the items in QTreeWidget will be from left to right in orientation.
Read a post where one can not just use paint for QTreeWidget.
Need all the help i can get.
Thanks!

wysota
12th January 2012, 11:49
Reimplement QTreeView::drawBranches() or QTreeView::drawRow().

ommharidaas
19th January 2012, 10:35
Reimplement QTreeView::drawBranches() or QTreeView::drawRow().


Hi Wysota,
Thanks for putting me in a right direction. Have implemented QTreeView::drawRow().
A small hick-up though.
Is there any way to find out which brach of the tree has sub-trees??
Need little insight.

wysota
19th January 2012, 11:29
Query the model for it and/or use the information provided in QStyleOptionViewItem object.

ommharidaas
20th January 2012, 08:58
Query the model for it and/or use the information provided in QStyleOptionViewItem object.

Wysota,
I could not find any information (methods that can be used) on QStyleOptionViewItem object. I guess its only meant for increasing the aesthetics of the widget. Please enlighten me with what all can be achieved with QStyleOptionViewItem object.
Though i was able to accomplish wat i was tryin to achieve... (Thnx to ur previous post).
Cheers to Qt!

ommharidaas
24th January 2012, 08:01
Wysota,
I could not find any information (methods that can be used) on QStyleOptionViewItem object. Though i was able to accomplish wat i was tryin to achieve... (Thnx to ur previous post).
Cheers to Qt!



Hi Wysota,
Also, on second thoughts, I wanted to ask you whether this sort of customization is achievable using style sheets alone??
Please help.

wysota
24th January 2012, 09:47
I don't think so. And please stop using this ugly large blue font in your posts.