Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在用 pyside6 编写一个编辑器,并使用 qtextedit 作为主要小部件。编辑器应让用户有机会在正常黑色文本(下划线和删除线)上方/下方用彩色线标记文本中的错误。下划线可以通过 setUnderlineColor() 轻松着色,但删除线不能着色。我尝试使用光标和画笔,但没有效果。我的问题是:
从 qt 6.2(使用 pyside6 测试)开始,现在可以在编辑器中使用彩色删除线。setUnderlineColor()用和组成格式setFontStrikeOut(),然后合并格式。它现在甚至存在于 html 和 odf 导出中。
setUnderlineColor()
setFontStrikeOut()