[PyQt] Strange bug in PyQt
Andreas Pakulat
apaku at gmx.de
Fri Aug 8 22:43:12 BST 2008
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/
> 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.
Andreas
--
You're a card which will have to be dealt with.
More information about the PyQt
mailing list