PDA

View Full Version : QPlaintTextEdit and setFont to selected Char



Pablik
15th July 2012, 12:08
Hi, how can setFont() to selected char in QPlainTextEdit (no to all QPlainTextEdit) ???

wysota
15th July 2012, 12:19
QTextCursor::setCharFormat()

Pablik
15th July 2012, 14:43
setCurrentCharFormat () it's work thx ;)
i have next question, if i want save all text inside QPlainTextEdit to file and load this text(with this font), then i have make big array of QTextCharFormat and save this TextCharFormat for each char in QPlainTextEdit, or is better way ??

wysota
15th July 2012, 14:54
You can use any approach you like as long as you write code that is going to read the text back from the file. Or you can save the text using html subset of which is supported internally by QTextDocument.