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. Stylesheet QRadiobutton

Stylesheet QRadiobutton

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 2.0k Views
  • 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.
  • O Offline
    O Offline
    OPit
    wrote on last edited by
    #1

    Hi,
    I try to change style of my QRadioButton. But when this one is disabled, a new color appears to create a shadow effect, but I don't know how to change or remove this color in qss file.
    Someone can help me ?

    Here, shadow color is white.
    css_shadow.png

    JonBJ 1 Reply Last reply
    0
    • O Offline
      O Offline
      OPit
      wrote on last edited by
      #5

      I found the solution !

      just add :

      QRadioButton  {
          background: transparent;
      }
      

      and it works, stange ...

      Thanks

      1 Reply Last reply
      1
      • O OPit

        Hi,
        I try to change style of my QRadioButton. But when this one is disabled, a new color appears to create a shadow effect, but I don't know how to change or remove this color in qss file.
        Someone can help me ?

        Here, shadow color is white.
        css_shadow.png

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @OPit
        You should show what stylesheet rule you are currently using to affect the radiobutton.
        In this case, because of disablement you may need to deal with rule: QRadioButton:!enabled { ... }. The "shadow effect" is how (Windows?) shows disabled text.

        1 Reply Last reply
        0
        • O Offline
          O Offline
          OPit
          wrote on last edited by
          #3

          That's what I've already done :

          QRadioButton:disabled {
          	
          	color: #666;  
          }
          

          Thanks

          JonBJ 1 Reply Last reply
          0
          • O OPit

            That's what I've already done :

            QRadioButton:disabled {
            	
            	color: #666;  
            }
            

            Thanks

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #4

            @OPit
            Can only say: search https://doc.qt.io/qt-5/stylesheet-reference.html. I thought it might be text-decoration, but seemingly not. There is a mention of shadow, if that's what it is.

            Also see https://forum.qt.io/topic/78123/stylesheet-for-disabled-qpushbutton-under-win-xp/6, I have a feeling { etch-disabled-text: 0; } is supposed to control it but does not work.

            Otherwise if cannot do it via stylesheet, may have to do it through QStyle.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              OPit
              wrote on last edited by
              #5

              I found the solution !

              just add :

              QRadioButton  {
                  background: transparent;
              }
              

              and it works, stange ...

              Thanks

              1 Reply Last reply
              1

              • Login

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