I started creating a drawing program that interacts with drawing tablets. Depending on the pen pressure on the tablet, I change the value of the alpha line of the line. This mechanism works.
The thin lines look decent and it looks like a real sketch. But since I draw lines between two points (for example, in the Qt doodle tutorial) to draw, there is an alpha overlap between the joints of the lines, and this is very noticeable for thick strokes.
This is the effect with the line conveyor: 
As you can see, there is an ugly alpha mix between the line segments.
To solve this problem, I decided to use QPainterPath strings for rendering. Two problems with this:
- A long, continuous, thick path quickly lags behind the program.
- Since the path is connected, it acts as one, so any change in the alpha value affects the entire path (which I do not need, since I want to keep the blending effect).
The following images use QPainterPath .
The blend effect I want to keep. 
The following figure shows a second problem that changes the alpha and thickness of the entire path 
The red text should read: "if more pressure is added without removing the pen from the surface of the tablet, the line thickens" (and alpha becomes opaque)
Another thing is that with this approach I can only get a mixed trace from dark to light (or a thick thin path width), but not from light to dark. I’m not sure why this effect occurs, but I believe that it relates to path line segments that are being updated as a whole.
I did a program to increase / decrease the alpha and line thickness depending on the pen pressure on the tablet.
The problem is that I want to render lines without alpha overlap, and QPainterPath updates the entire alpha path and thickness that I don't want.
This is the code that creates the path:
switch(event->type()){ case QEvent::TabletPress: if(!onTablet){ onTablet = true; //empty for new segment freePainterPath(); path = new QPainterPath(event->pos()); } break; case QEvent::TabletRelease: if(onTablet) onTablet = false; break; case QEvent::TabletMove: if(path != NULL) path->lineTo(event->pos()); if(onTablet){ //checks for pressure of pen on tablet to change alpha/line thickness brushEffect(event); QPainter painter(&pixmap); //renders the path paintPixmap(painter, event); } break; default:; } update();
The desired effect that I want as one path (image created using the Krita paint program): 