Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, December 2006
How to tell whether an item is selected in a QTreeView


Message 1 in thread

Hi,
   In a QTreeView, if multiple selection is enabled,
click+shift+ctl will mark (highlight) the appropriate
items. Then, how to check (in a for/while loop) whether
an item is selected?
   Thanks, have a good holiday.
-- 
 [ signature omitted ] 

Message 2 in thread

Honglin Ye schrieb:
> Hi,
>    In a QTreeView, if multiple selection is enabled,
> click+shift+ctl will mark (highlight) the appropriate
> items. Then, how to check (in a for/while loop) whether
> an item is selected?

yourView.selectionModel()->selected[Indexes|Rows|Columns]() should do 
what you need.

Martin

-- 
 [ signature omitted ]