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

bvz bvz at c381.com
Mon Oct 5 01:16:02 BST 2009

Aha, that was it. I installed the version on my Mac myself, and the Linux is
installed by the IT dept at my company. I will just have to code around it.

By the way, being new to all of this, is there someplace where I could have
gone to figure this out myself?  Maybe first I need to understand what the
sip is and does, and then someplace to figure out what is changing in the
various releases?

Thanks again.


Hans-Peter Jansen-2 wrote:
> 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
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

View this message in context: http://www.nabble.com/Mac-does-not-pass-back-QIcon-from-data%28%29-method-in-a-model-view-tp25726451p25743607.html
Sent from the PyQt mailing list archive at Nabble.com.

More information about the PyQt mailing list