Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why is it so hard to style the links in a QLabel?

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    philk
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NicuPopescu
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • P Offline
        P Offline
        philk
        wrote on last edited by
        #3

        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 :/

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved