QT之QTextEdit使用總結

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章