PDA

View Full Version : multiple selection of list view items



samirg
30th October 2007, 18:45
I am using PyQt (Python 2.3 and Qt 3.3),

I have QListView widget, I set "Extended" selection mode at time of creation. When I
select multiple items (using Shift key), I want to get hold of those selected items
in list view, however, could found a way to do so.

What is the way to get all selected items in listview?

I checked I don't have QItemSelection or QItemSelectionModel in the Qt version, I am
using.

regards,

marcel
30th October 2007, 18:56
You can iterate through all the QListViewItems via QListView::firstChild() and QListViewItem::nextSibling() and see which ones are selected with QListViewItem::isSelected.

jpn
30th October 2007, 19:05
Or use QListViewItemIterator with "Selected" flag.