[PyQt] Re: Fixed... QComboBox and Models

Martin Höfling martin.hoefling at gmx.de
Wed Feb 27 10:39:27 GMT 2008


Am Tuesday, 26. Februar 2008 schrieb Martin Höfling:

OK, found it myself.

>     def data(self,index,role=Qt.DisplayRole):
>         if not index.isValid() or not (0<=index.row() < len(self.list)):
>             return QVariant()
>         if role == Qt.DisplayRole or role == Qt.EditRole:
>             return QVariant(self.list[index.row()])
>         else:
>             return QVariant(self.list[index.row()])

The last line is...
...stupid. ;-)

Cheers
	Martin





More information about the PyQt mailing list