[Qt-interest] Multi-Column Lists

Kishore kitts.mailinglists at gmail.com
Wed Oct 6 15:50:32 CEST 2010


On Wednesday 06 Oct 2010 6:12:22 pm Jake Colman wrote:
> >>>>> "AS" == Andre Somers <andre at familiesomers.nl> writes:
> 
>    AS>   Op 6-10-2010 0:12, Jake Colman schreef:
> 
>    >> I'm porting from Qt3 to Qt4.  What is the Qt4 equivalent of the
>    >> Q3ListView and Q3ListViewItem?  I'm looking to create a
>    >> multi-column readonly list of items.  In Qt3 this was a "list" as
>    >> opposed to a "table".  I don't see how Qt4's QListView/Widget or
>    >> QTreeView/Widget can be used the same way.  What am I missing?
> 
>    AS> The closest to the Qt3 list view, is QTreeWidget. However, for
>    AS> what you describe above, I think you need the QTableWidget. Note
>    AS> that if you don't like the default looks of QTreeView (or
>    AS> -widget, same thing), you can change that in a few lines of code.
> 
> But will this give me a row-oriented list with multiple columns?  I do
> NOT want the user to move from cell to cell.  Arrows should
> move from row to row but not from column to column.  The user drags a
> slider to see more columns.  I would not make sense for Qt to have
> dropped this support for this kind of widget.  Perhaps it's an option on
> the QTableWidget.  I'll have to check.

Will the option QAbstractItemView::setSelectionMode(QAbstractItemView::SelectRows ) do the job?
-- 
Cheers!
Kishore



More information about the Qt-interest-old mailing list