[PyKDE] viewing a QStandardItemModel

alexander krohn ak at e-dict.net
Wed Feb 21 17:43:03 GMT 2007


hi.

i have a column in a QStandardItemModel filled with a numerical value. now i 
want to show this in a QTableView in a different way, the value represents some 
kind of state, so i don't want to see a number, but a string like "ok" or "not ok".

although i think that is an aspect of the view, i thought that the roles can do 
this, so i set the numerical value for the Qt.EditRole and the string for 
Qt.DisplayRole.

so much for the theory, it doesn't work. so attached code shows twice the string 
"one" and not 1 and "one" as i would expect.

any ideas?

alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: standarditemmodel.py
Type: text/x-python
Size: 347 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070221/fe877925/standarditemmodel.py


More information about the PyQt mailing list