Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QPainter drawText line spacing
ivanicy last edited by
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
m.sue last edited by
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.
Vinod Kuntoji last edited by
You can elide the text if it is too long, You can refer this,