Just a remark; a classic performance hit when drawing text using QPainterPath is to set the painter pen, or rely on the painter's default pen, forcing QPainter to render the text outline. The outline is extremely complex for text, and in most cases you don't want it - instead you just want to fill the text; i.e., set the brush and disable the pen. So:
path.addText("Ladada");
painter.drawPath(path); // <- slow! draws the outline with the default pen set
painter.setPen(Qt::NoPen);
painter.setBrush(Qt::black);
painter.drawPath(path); // <- fast!
QPainterPath path;
path.addText("Ladada");
QPainter painter(...);
painter.drawPath(path); // <- slow! draws the outline with the default pen set
painter.setPen(Qt::NoPen);
painter.setBrush(Qt::black);
painter.drawPath(path); // <- fast!
To copy to clipboard, switch view to plain text mode
Bookmarks