QPainter drawText line spacing
I am trying to set a line spacing when I use the drawtext function. I am using this version of the function:
void drawText(const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption())
But, the lines are very close and a little overlapping. Someone knows how to fix it?
Thank you very much
You can only get the lineSpacing using the QFontMetrics class but not set it (independent of the font size, that is). So you will have to do it yourself using the y-coordinate of the QRect in the drawText function.
You can elide the text if it is too long, You can refer this,