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();