QLabel几种小技巧

来源:互联网 发布:java缓存面试题 编辑:程序博客网 时间:2024/06/05 01:02

1、设置行间距

QLabel没有设置行间距的函数,所以这种办法是行不通的。只能采用其它类似的方法来实现,例如设置行高,使用样式代码如下:

<p style='line-height:18px'>推荐</p>


2、链接文本

实现点击Label,即可打开网页,且文本没有下划线效果,如下:

<a href="http://www.sina.com"><span style="text-decoration: none; color:#ff0000">新浪</style></a>

text-decoration: none,表示没有文本修饰,下划线就没有了。


原创粉丝点击