[PyQt] QComboBox insert policy
tinaweb at bestemselv.com
Thu Apr 19 11:53:08 BST 2007
I have a QComboBox (Qt4) where I want to insert items alphabetically.
Pyuic4 generated this:
self.depArea = QtGui.QComboBox(self.centralwidget)
And the code that inserts the items in my program:
for select in range(len(airports.areasIncluded)):
airports.areasIncluded[select - 1])
'airports.areasIncluded' is a list of unicode elements. A snippet of it
(it's very long):
areasIncluded = [u' Spain, Portugal', u' France', u' Greece', u' Italy',
u' Estonia, Latvia, Lithuania', u' Poland']
The problem is of course that the item is inserted at position 'select'
and not where it fits in the alphabet. And from the documentation I can
not find any insert methods that does not require the 'index'. Am I
Any help will be greatly appreciated!
More information about the PyQt