Opacity with custom QGraphicsItem
I wrote a custom graphics item that paints an image with the following code:
That work very well, but when the item’s opacity is less then 1 the colors in the image do not fade to the background color, but to the respective inverse color: It seems that instead of
- (1 - opaticy) * backgroundColor + opacity * color
the new color is
- (1 - opaticy) * (backgroundColor - color) + opacity * color
For other items such as QGraphicsTextItem the opacity works as expected. Can somebody point me to what the problem might be?