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. [SOLVED]QRadioButton Style Sheet Issue
QtWS25 Last Chance

[SOLVED]QRadioButton Style Sheet Issue

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 9.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.
  • K Offline
    K Offline
    Kritika
    wrote on last edited by
    #1

    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
    1
    • S Offline
      S Offline
      Saugglocke
      wrote on last edited by
      #2

      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
      1
      • K Offline
        K Offline
        Kritika
        wrote on last edited by
        #3

        Thanks Saugglocke.

        It is working absolutely as i want.

        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