首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >qtooltip用单行qt显示句子

qtooltip用单行qt显示句子
EN

Stack Overflow用户
提问于 2015-01-21 11:38:03
回答 1查看 880关注 0票数 1

在一行中显示没有任何丰富文本的工具提示很好。但我的工具提示里有丰富的文字。

代码语言:javascript
复制
QString tooltip="<span class=nobr>This is a much longer line than the first</span>";

这是显示在3行。我怎么能把它限制在1行。我试过的东西

代码语言:javascript
复制
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>";

如何在单行中显示包含丰富文本的工具提示?谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-21 12:18:08

文档声明:

.

所以像这样的东西会起作用:

代码语言:javascript
复制
QString tooltip = "<p style='white-space:pre'>This is a much longer line than the first</p>";
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28066310

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档