在一行中显示没有任何富文本的工具提示正常工作。但我的工具提示中有丰富的文字。
QString tooltip="<span class=nobr>This is a much longer line than the first</span>";
以3行显示。我如何将其限制为1行。我试过的事情
QString tooltip="<nobr>This is a much longer line than the first</nobr>";
QString tooltip="<span class=nobr>This is a much longer line than the first</span>";
QString tooltip="<span 'white-space:nowrap'>This is a much longer line than the first</span>";
如何在单行中显示包含富文本的工具提示 提前谢谢
答案 0 :(得分:4)
文档声明:
所以这样的事情会起作用:
QString tooltip = "<p style='white-space:pre'>This is a much longer line than the first</p>";