How can I select a href tags in a QTextBrowser from QSS?

纵然是瞬间 提交于 2019-12-25 02:59:54

问题


I would like to format my clickable URLs inside a QTextBrowser. In a QSS file that I set for the entire application, I've tried QTextBrowser::text.a and QTextBrowser.a, but neither worked. Am I actually expected to manually format every link using the Qt Creator editor, or is there a way around this?


回答1:


You can’t use QSS for that, but QTextBrowser supports a subset of CSS, so you can make it part of the displayed HTML, or set a default stylesheet: QTextDocument::defaultStyleSheet.



来源:https://stackoverflow.com/questions/33188370/how-can-i-select-a-href-tags-in-a-qtextbrowser-from-qss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!