[Qt-interest] Bug in Qt 4.5.1 QGraphicsItem setOpacity?

Ian Thomson Ian.Thomson at iongeo.com
Wed Apr 29 16:54:55 CEST 2009


Hi,

I can confirm I see the same thing on red hat 5 linux with Qt 4.5.1.

I examined your test program and I am suspicious that there could be a 
problem with floating point comparisons, but in any case just setting 
the opacity to 0.0 doesn't seem to alter how it is displayed. It does 
seem to be a Qt issue.

Hope this helps,
Ian.

Murphy, Sean M. wrote:
> I've got problem with setting the opacity on QGraphicsPixmapItem's.  I
> first noticed it in my real application, and then came up with a test
> application that reproduces the problem, which I've included.
> 
> When you run the test application, you get a QGraphicsScene with a
> checkerboard pattern background.  Over the top of the background, I've
> put in 4 colored QGraphicsPixmapItem's.  I then have a timer that sets
> the opacity of the 4 colored items from 0.0 to 1.0 in 0.2 steps, then
> decreases the opacity from 1.0 to 0.0 in 0.2 steps, and repeats this
> process forever.
> 
> On my Mac running Qt 4.5.0 this seems to work perfectly, when the
> opacity of the tiles is 1.0 I can't see the checkerboard pattern through
> them, and when their opacity is set to 0.0, I can only see the
> checkerboard pattern.
> 
> On my Windows machine, running the versions of Qt and mingw provided by
> qt-sdk-win-commercial-2009.02.exe, at opacity of 1.0 the checkerboard
> pattern is hidden (correct), but when the opacity is 0.0, I can still
> see evidence of the tile colors superimposed over the checkerboard
> pattern.
> 
> Can anyone confirm this?
> 
> Does anyone know what to do to work around it?  On Windows, explicitly
> hiding the items when their opacity reaches 0.0 doesn't seem to work
> either...
> 
> Sean
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list