Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Stylesheet QRadiobutton

    General and Desktop
    2
    5
    518
    Loading More Posts
    • 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
      OPit last edited by

      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

      JonB 1 Reply Last reply Reply Quote 0
      • O
        OPit last edited by

        I found the solution !

        just add :

        QRadioButton  {
            background: transparent;
        }
        

        and it works, stange ...

        Thanks

        1 Reply Last reply Reply Quote 1
        • JonB
          JonB @OPit last edited by JonB

          @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 Reply Quote 0
          • O
            OPit last edited by

            That's what I've already done :

            QRadioButton:disabled {
            	
            	color: #666;  
            }
            

            Thanks

            JonB 1 Reply Last reply Reply Quote 0
            • JonB
              JonB @OPit last edited by JonB

              @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 Reply Quote 0
              • O
                OPit last edited by

                I found the solution !

                just add :

                QRadioButton  {
                    background: transparent;
                }
                

                and it works, stange ...

                Thanks

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post