QT之QTextEdit使用总结

时间:2014-03-19 12:10:48   收藏:0   阅读:935

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

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!