• 5019阅读
  • 0回复

QGraphicsTextItem 的 toHtml() 方法能简化一下输出嘛? [复制链接]

上一主题 下一主题
离线tankery
 

只看楼主 倒序阅读 楼主  发表于: 2011-04-19
QGraphicsTextItem 中有 setHtml() 和 toHtml() 这个方法,但是toHtml返回的结构很复杂。
比如我用
<font size="8" color="green">This is a English title.</font>
来setHtml。
接着用toHtml。它返回的结果是:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;">This is a English title.</span></p></body></html>

忒复杂了。。
各位有没有什么简单一点的办法能简化这个输出呢?一定要自己解析吗?
非常感谢!!
[ 此帖被tankery在2011-04-19 10:33重新编辑 ]
快速回复
限100 字节
 
上一个 下一个