[PyQt] Mac does not pass back QIcon from data() method in a model/view

Hans-Peter Jansen hpj at urpla.net
Sat Oct 3 20:51:11 BST 2009


Am Samstag 03 Oktober 2009 schrieb bvz:
> I have just noticed this little oddity:
>
> I have a data() method inside a QAbstractTableModel subclass.  This
> method is supposed to pass back an icon for a QTableView to display when
> the role Qt.DecorationRole is used.
>
> On the Mac it will only return the icon if I use:
> return QtGui.QIcon(paramObj.get_icon())
>
> On Linux, it will only work if I use:
> return QtCore.QVariant(paramObj.get_icon())
>
> Am I doing something wrong, or is this just a little weirdness that I
> should code around?

I bet, you're using different sip versions then, and yes, there was some 
changes in this area during the last few releases on the way to eliminate 
QVariant. Either update sip and PyQt on Linux or deal with it...

Pete


More information about the PyQt mailing list