问题
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