• 6687阅读
  • 2回复

QTextEdit的小问题 [复制链接]

上一主题 下一主题
离线sdr40725
 
只看楼主 正序阅读 楼主  发表于: 2006-03-23
小弟写了一个程式,想分批将运算结果印在TextEdit

但不太懂TextEdit中的换行该如何使用

如果只是每一次印出就断行一次该如何写呢?!

希望懂得大大能指点一下..谢谢
离线obrire

只看该作者 2楼 发表于: 2006-03-23
如果不行
static const char * const message =
  "<p><b>Qt Main Window Demo</b></p>"

  "<p>This is a demonstration of the QMainWindow, QToolBar and "
  "QDockWidget classes.</p>"

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

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

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

只看该作者 1楼 发表于: 2006-03-23
\n呀,如者是\n\r
快速回复
限100 字节
 
上一个 下一个