• 4644阅读
  • 4回复

[提问]设置了textEdit其中一行字为红色,过一会儿怎么全变成红的了 [复制链接]

上一主题 下一主题
离线cltg
 
只看楼主 倒序阅读 楼主  发表于: 2011-09-22
我设置了textEdit其中一行字为红色,
过一会儿重新输入QString,怎么输入的全变成红色的字体了,
我的代码是:
                    QString strQ,strQ1;
........
                    strQ.append(QObject::tr("<font color=red>%1 </font>").arg(strQ1));        
                    TextEdit->append(strQ);
开始时没有问题,可是等五分钟后再输入就全变成红色了
这是怎么回事儿啊,邪门儿了,请高手帮忙看一下!
离线wxj120bw

只看该作者 1楼 发表于: 2011-09-23
回 楼主(cltg) 的帖子
打印下5分钟后的QTextEdit的内容
离线abcdlcq

只看该作者 2楼 发表于: 2011-09-23
void QTextEdit::append ( const QString & text )   [slot]

Appends a new paragraph with text to the end of the text edit.

Note: The new paragraph appended will have the same character format and block format as the current paragraph, determined by the position of the cursor.
离线cltg
只看该作者 3楼 发表于: 2011-09-23
五分钟前反复打印,都是只有一条是红色的
870773120029 754   2011-08-01    2039-01-01
----------------------------------

===================================================
程序开着,放在那儿不动,过一会儿在打印,就全是红色了。
870773120029 754   2011-08-01    2039-01-01
----------------------------------

===================================================
离线cltg
只看该作者 4楼 发表于: 2011-09-23
回 2楼(abcdlcq) 的帖子
明白了,谢谢啦
快速回复
限100 字节
 
上一个 下一个