PDA

View Full Version : Can a QListView support multi-column?



wesley
7th March 2008, 03:19
I am using Qtopia4.3.2 to implement a multi-column list view.

But I don't want to use QTreeView. Because it seems more expensive on resource.
and I don't need a hierarchical architecture.

I want my list view work like a QListView, but i may have some column in one item.

I notice that there is a interface setModelColumn() , does it work?

Can some one give me some suggestion>? thanks/

jpn
7th March 2008, 07:42
I am using Qtopia4.3.2 to implement a multi-column list view.

But I don't want to use QTreeView. Because it seems more expensive on resource.
and I don't need a hierarchical architecture.
There is no such thing as columns in QListView. QListView represents a flow of items. The flow of items can be in "list mode" or "icon mode" and optionally it can be wrapping. Multiple columns do not fit to this concept.


I notice that there is a interface setModelColumn() , does it work?
QListView can represent a single column. This sets the column it represents.


Can some one give me some suggestion>? thanks/
QTreeView is the way to go, unless you want to write a view of your own, which would be a big amount of work. Did you notice QTreeView::uniformRowHeights?

wesley
7th March 2008, 08:50
yes, I had tried to implement it use QListView, but it seems very hard.

and now, i am prefer the QTreeView,. How can i do the maximum optimizations if I want to my multi-column list view work like a QListView, just can show some column on one item, of course, the columns on one row item haf focus.

So, I don't need the QTreeView's hierarchical architecture, and its expand/collapse, etc.

HOw can i have a prefer multi-column list view? Is there some example?

thank you..!!!

jpn
7th March 2008, 09:00
Take a look at various QTreeView properties:

QTreeView::setRootIsDecorated
QTreeView::setUniformRowHeights
QTreeView::allColumnsShowFocus