首页 > 其他 > 详细

QT之QTextEdit使用总结

时间:2014-03-19 12:10:48      阅读:934      评论:0      收藏:0      [点我收藏+]

QTextEdit* m_textShower;//显求读取文件内容的文本

m_textShower = newQTextEdit;


(1)设置字体的方法

..............

QFonttextFont;

textFont.setPointSize(16);

m_textShower->setFont(textFont);


(2)设置编辑为只读属性的方法

m_textShower->setReadOnly(true);


(3)设置文字的方法

QTextCursorcsor = m_textShower->textCursor();

csor.movePosition(QTextCursor::Start);

csor.insertText(fileContext);


(4)清除文字的方法

m_textShower->clear();

本文出自 “北荒苍狼” 博客,请务必保留此出处http://langtuteng.blog.51cto.com/2995236/1378444

QT之QTextEdit使用总结,布布扣,bubuko.com

QT之QTextEdit使用总结

原文:http://langtuteng.blog.51cto.com/2995236/1378444

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!