I have a QLabel
with a Qt stylesheet that sets a dark background:
QLabel {
background: black;
color: white;
}
This works fine unt
I've had little success explicitly setting the QPalette
-- it works if you set it for the entire application, but not if you set it in the widget. In the end though, the easiest thing for what I needed to do was use a QTextBrowser instead which supports a subset of HTML. I could then override the colour of links using a regular CSS stylesheet:
QTextBrowser browser;
// IMPORTANT! - set the stylesheet before the content
browser->document()->setDefaultStyleSheet("a {color: white; }");
browser->setText(html);