[PyQt] Strange bug in PyQt

Roberto Alsina ralsina at kde.org
Fri Aug 8 23:42:19 BST 2008


On Friday 08 August 2008 18:43:12 Andreas Pakulat wrote:
> On 08.08.08 16:36:35, Roberto Alsina wrote:
> > I don't know how to explain it, si I have to use pictures.
>
> Are you talking about the cut-off menu items? Or what? Which parts of
> the pictures should we look into/

Cutoff menu items, varying font sizes, the "Search" label, even the left 
qtreeview's header is weird.

Loos like font metrics were all cray.

> > 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)
>
> Note that the icon here might vanish as soon as the function is left, so
> your items might have invalid icons - unless they do a deep-copy of the
> given item.

It's in the module's scope so it shouldn't be deleted while the module is 
imported. Also since the icon is diplayed I'm assuming it's not deleted.

-- 
 ("\''/").__..-''"`-. .         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