PDA

View Full Version : Direct root childs inline QTreeView



faraslacks
15th January 2009, 03:23
Functionality of QTreeView is not enough for my trouble: my model have 2 hierarchical levels. First level - name of group of items. Second level - items in table. I want to use QTreeView, and have a problem: names of groups are very long strings (about 200 characters) and if I want to see all group name I have to resize first column of my QTreeView.

That is standard functionality:

http://pic.ipicture.ru/uploads/090115/33853/FiTPif9CsW.png

That what I want to get:

http://pic.ipicture.ru/uploads/090115/33853/jF6AH7Ps0A.png

Can QTreeView do that (may be I need special model)? If it cann't, how can I reimplement it?

P.S. Excuse me for my English.

aamer4yu
15th January 2009, 07:03
May be you can try using QTreeView::drawRow by inheriting your treeview class

You can set some type for the item to identify it. Then draw row urself.
For other rows, you will need to simply call the base class function :)

caduel
15th January 2009, 07:45
see QTreeView::setFirstColumnSpanned()

HTH