[PyQt] How do I change a mixed font format?

bluekyu bluekyu.dev at gmail.com
Tue Feb 21 04:43:09 GMT 2012

Hello. I have a problem about QTextEdit. Setting font functions of 
QTextEdit do not work as those of word processor.

I want to change mixed font formats consistently.
For example, selected text is """<p 
I want to apply "underline" to the text, so I can use 
And then, the text is """<p style="font-style:italic; 

However, if I use QTextEdit.setCurrentFont for "strike out", all text is 
set to font of last cursor
as """<p style="text-decoration:line-through;">Text1</p><p 

setFont* functions of QTextEdit work well, but using setCurrentFont for 
unsupported function does not work as word processor.

How can I do that?

More information about the PyQt mailing list