gpt4 book ai didi

qt - QLabel : interlinea/linespacing in WordWrap mode

转载 作者:行者123 更新时间:2023-12-04 12:42:18 24 4
gpt4 key购买 nike

在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com