首页| 论坛| 消息

标题:QTextEdit的小问题
作者:sdr40725
日期:2006-03-23 15:30
内容:

小弟写了一个程式,想分批将运算结果印在TextEdit
但不太懂TextEdit中的换行该如何使用
如果只是每一次印出就断行一次该如何写呢?!
希望懂得大大能指点一下..谢谢


#1 [obrire 03-23 15:40]
\n呀,如者是\n\r
#2 [obrire 03-23 15:42]
如果不行
static const char * const message =
"

Qt Main Window Demo

"
"

This is a demonstration of the QMainWindow, QToolBar and "
"QDockWidget classes.

"
"

The tool bar and dock widgets can be dragged around and rearranged "
"using the mouse or via the menu.

"
"

Each dock widget contains a colored frame and a context "
"(right-click) menu.

"
QTextEdit *center = new QTextEdit(this);
center->setReadOnly(true);
center->setHtml(tr(message));
HTML语法你会吧
就这样简单,还是Trolltech有先见呀

回复 发表
主题 版块