PyQt: QListView how to retrieve selected items?

Flavio fccoelho at gmail.com
Thu Feb 2 16:39:25 EST 2006


Iterating over the items and checking if it is selected, sounds like a
good idea, but there no obvious way to get a hold of the list of
items!! The only way you  can get an item is if you are in single
selection mode and you call selectedItem(). But I have to use multiple
selection mode, for which this method does not work (it says so in the
docs)

The signal selectionChanged() is emitted whenever the set of selected
items has changed but does not return any information regarding the
items comprising the set. Also useless.

> And all of this can be found within 20 seconds in the great Qt-Docs.
> Especially easy with the included QAssistant, a help-browser with
> indexing and whatever...

The docs are really great, it's this particular widget that appear to
lacking some important functionality! This is very sad.




More information about the Python-list mailing list