Making the sheet displaying QGraphicsItem CanvasItem of Calligra transparent on a GraphicsScene

Boudewijn Rempt boud at valdyas.org
Mon Dec 3 11:03:14 GMT 2012


On Monday 03 December 2012 Dec, Philip Van Hoof wrote:
> Hi Boudewijn Rempt,
> 
> I think my solution will be useful for future users of Calligra's
> components. This is what I came up with, and this is working as
> expected: cells that had no background info set become transparent,
> cells that have background info set retain that background as
> non-transparent (this is my expected result). I guess opacity setting
> could still be used (while painting or globally) in case somebody wants
> cells with background info set to be semi-transparent (but for my
> use-case this isn't the case). I would o could have decorated painter
> instead of writing to the original, and then passing my decorated one to
> super's method, but it looks like QPainter has no copy constructor. And
> I think that if I just restore painter that it'll all be fine too.

Yes, that looks like a good solution!

-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl



More information about the calligra-devel mailing list