[PyQt] Strange bug in PyQt

Roberto Alsina ralsina at kde.org
Fri Aug 8 20:36:35 BST 2008


I don't know how to explain it, si I have to use pictures.

Here's how my app looks when things go "bad":

http://flickr.com/photos/ralsina/2744179213/

Here's the "good":

http://flickr.com/photos/ralsina/2744178603/

What's the difference in the code? This:

In the good version, I create the "star" icon for each item:

      item1.setIcon(QtGui.QIcon(':/star.svg'))

In the bad version, I created a global:

star=QtGui.QIcon(':/star.svg')

And used it instead:

      item1.setIcon(star)

I had the same thing happen to another app before and never figured out why it 
happened.

I am using 

qt 4.4.0
pyqt 4.4.2
python 2.5.2

On Linux.

Any ideas?


-- 
 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  KDE Developer (MFCH)
 (_Y_.)' ._   ) `._`.  " -.-'  http://lateral.netmanagers.com.ar 
  _..`-'_..-_/ /-'_.'     The 6,855th most popular site of Slovenia   
(l)-'' ((i).' ((!.'       according to alexa.com (27/5/2007) 
                    
Debugging is twice as hard as writing the code in the first place. 
Therefore, if you write the code as cleverly as possible, you are, 
by definition, not smart enough to debug it. --Brian W. Kernighan



More information about the PyQt mailing list