Why is it so hard to style the links in a QLabel?



  • I really have to wonder... you can style almost every aspect of a Qt App but the links inside a QLabel always look the same. Its not respecting the widgets QPalette, not the apps QPalette, not the apps/widgets CSS... nothing. Making links in a different colour and react on hover with a change in text-decoration is impossible it seems.



  • Hi,

    try this:

    #labelLink
    {

    background-color:rgba(255,0,0,100);
    qproperty-text:"<aa href="http://www.qtcentre.org" style="color: rgba(0,255,0,255)">QtCentre</a>";/* delete one a*/
    }

    #labelLink:hover
    {

    background-color:rgba(0,0,255,100);
    }

    though I have found no way to set text'color on hover



  • Thanks for your efforts. I think I will go with a custom control. All this hacking and the links colour can still not be changed on hover :/


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.