[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Plasma::Svg question
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2008-10-06 19:46:35
Message-ID: 200810061346.36407.aseigo () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Monday 06 October 2008, Toussis Manolis wrote:
> I need a little help about Plasma::Svg
>
> I know I can use paint() to draw a Plasma::Svg object on the QPainter of a
> Plasma applet.
> What I need is to draw it with alpha=0.3 . How I can do that?

this isn't specific to Plasma::Svg, but applicable to any pixmap painting of 
this type.

what you can do is paint the Svg to a temporary pixmap, and then paint over it 
using a colour the appropriate alpha value. see QPainter::setCompositioMode 
for how to set how paint operations like this get combined.

then you paint that temporary pixmap onto your applet.

you can also call setOpacity on the QPainter directly, but that can *very* 
slow and that above method is usually faster, and at worst the same speed.

if you can describe your use case in more detail, we may be able to offer more 
specific directions (e.g. perhaps PaintUtils::transition would work for you, 
but that highly depends on what you are trying to do).

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech


["signature.asc" (application/pgp-signature)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic