在 WordWrap 模式下,如何在 QLabel 中设置行高?
最佳答案
使用 HTML 文本:
QString template = "<p style=\"line-height:%1%\">%2<p>";
QString targetText = template.arg(myPercentage).arg(myTex);
QLabel *l = new QLabel(targetText, this);
其中 myPercentage 就像 60 - 80。
您将在 WordWrap 模式下获得浓缩行
关于qt - QLabel : interlinea/linespacing in WordWrap mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2749612/