tinaweb at bestemselv.com
Tue Jan 16 18:57:44 CET 2007
I'm fairly new to both Python and Qt so please bare with me.
I have a QListView with a number of columns. In order to filter the
output I iterate using QListViewItemIterator looking for the string
entered by the user (filterString). Currently I do it this way:
it = QListViewItemIterator(self.authListView)
item = it.current()
if item.text(0).contains(filterString) or
item.text(1).contains(filterString) or item.text(2).contains(filterString):
Basically I iterate through the ListView until it goes beyond the list
and raise an exception, which I catch. It works but to be honest it
looks and feels ugly; "Do something until it goes wrong"
So, question: How can I know I have reached the last item in the QListView?
More information about the Python-list