Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    [SOLVED]QRadioButton Style Sheet Issue

    General and Desktop
    2
    3
    8026
    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.
    • K
      Kritika last edited by

      I want QRadioButton indicator to be of black color when checked and of white color when unchecked.
      For this, i have used this line of code and set at application level

      @a.setStyleSheet("QRadiobutton::indicator::checked{background-color:black;} QRadioButton::indicator::unchecked{background-color:white;}");@

      Using this, color requirement is fulfilled but the indicator shape is changed to square.
      I want QRadioButton indicator to be of round shape. Can anyone tell why this is happening?

      1 Reply Last reply Reply Quote 1
      • S
        Saugglocke last edited by

        Just play a bit with the stylesheet. Maybe something like this?

        @ QRadioButton::indicator::unchecked{ border: 1px solid darkgray; border-radius: 6px; background-color: white; width: 10px; height: 10px; margin-left: 5px;}

        QRadioButton::indicator::checked{ border: 1px solid darkgray; border-radius: 6px; background-color: black; width: 10px; height: 10px; margin-left: 5px;}@

        1 Reply Last reply Reply Quote 1
        • K
          Kritika last edited by

          Thanks Saugglocke.

          It is working absolutely as i want.

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