2017-08-03 112 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()