View Full Version : Change color of a link in QLabel using Style Sheets?

15th April 2008, 03:20
Hello, I have a QLabel with a link in it inserted with rich text. How would I change the color of that link? Changing the color property of QLabel doesn't seem to do anything. Thanks in advance!

15th April 2008, 08:15
You can use CSS to change the color.

label->setText("<a href=\"http://www.qtcentre.org\" style=\"color: red;\">Qt Centre</a>");

15th April 2008, 12:00
Wow! So obvious yet so discreet. Thanks!