首页| 论坛| 消息

标题:可以给lineEdit的不同字段设置不同的颜色吗?
作者:luckyyoung
日期:2011-03-28 20:05
内容:

我想给lineEdit中显示的字段设置不同的颜色,可以吗?
比如我输出“今天星期天”。我想让“今天”显示白色,“星期天”显示红色,可以吗?
网上好像只有设置整体颜色的方法。


#1 [qq723947150 03-28 21:18]
当然可以
#2 [roywillow 03-28 21:45]
A line edit allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop.
似乎不能……
用QTextEdit然后试试能不能禁止换行呢?
#3 [hrx1989 03-29 00:33]
楼主的问题真是很有创意的..
但是确实不知道要怎么实现呀...
#4 [linxy 03-31 10:46]
其实可以的实现的,下面是实现方法:
selection-background-color: white;
selection-color: red;
只要背景色设置成跟没选中的背景色一样就可以了
#5 回 1楼(qq723947150) 的帖子 [luckyyoung 03-31 12:56]
怎么弄?

<< 1 2 >> (1/2)

回复 发表
主题 版块