2017-08-03 34 views
-1

我要做出PyQt的文本編輯器PyQt的QTextCharFormat混合字體

方案1

enter image description here

enter image description here

enter image description here

方案選定的文本斜體2

enter image description here

enter image description here

enter image description here

的圖像是非常強的自我explaining.You可能會說,那麼你爲什麼不

只是你textEdit.setFontItalic(),那麼實際我已經在使用,但是

文本編輯沒有上劃線和刪除線,同時QTextCharFormat擁有噸的

屬性,但它有它的問題

textEdit.setCurrentCharFormat(),setCurrentFont(),setStyleSheet相同,setFont(),但所有

原因同樣的問題QTextCharFormat

是有辦法解決

感謝

+0

我也使用HTML標籤 –

回答

1

嘿,我已經得到了答案。

,而不是cursor.setCharFormat()使用cursor.mergeCharFormat()