Quantcast
Channel: Active questions tagged qpainter - Stack Overflow
Viewing all articles
Browse latest Browse all 49

qt drawing outlined text with QPainterPath

$
0
0

i have to draw outlined striked out text on QImage like that:

enter image description here

I do it as follows:

QPainter painter(this);QPainterPath path;QFont font;font.setPixelSize(95);font.setStrikeOut(true);font.setBold(true);path.addText(10, 150, font, "lololo");painter.setPen(Qt::blue);painter.setBrush(Qt::red);painter.drawPath(path);

and get this result:

enter image description here

As one can see the striking out line has zebra-like fill. How i can fill it completely with painter's brush?

I tried to change QPainter composition mode with no success. Also i tried to use QPainterPathStroker with the same result.

Sure i can draw striked out text with ordinary font (not striked out) plus rectangle, but it isn't a beautiful solution.


Viewing all articles
Browse latest Browse all 49

Trending Articles