[Qt-interest] Line joints overlapping with semi-transparent colour

Andrea Franceschini therealmorpheu5 at gmail.com
Tue Mar 31 12:00:14 CEST 2009


Hi everybody, I'm facing this problem:
http://img24.imageshack.us/img24/7389/alphawrong.png
I think it should be quite clear what's happening: I have a
semi-transparent pen and I draw subsequent segments using
QPainter::drawLine(). Obviously at the joints I have that overlapping
which sums up alpha and results in what you see.

I have two solutions:
1. discard transparency: feasible but ugly;
2. use an opaque color which is a mix between a certain degree of pen
colour and background colour: unfeasible because the background
changes all the time and in the future I might be interested in
showing background areas of different colours and even images.
Moreover I'd like to see what's below the trace (in case there's some
widget, for example).

Am I (as usual) missing some piece of the docs?

-- 
Andrea



More information about the Qt-interest-old mailing list