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. Setting background color for QCheckBox::indicator resets all other styling
Forum Updated to NodeBB v4.3 + New Features

Setting background color for QCheckBox::indicator resets all other styling

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 580 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.
  • M Offline
    M Offline
    Mahjouba
    wrote on last edited by
    #1

    Hi, I want to change the background of my checkbox, i tried this :

    QCheckBox::indicator{background-color:red;}

    but then the checkbox do not work.

    how can i change the background color without reset all other styling.

    JonBJ 1 Reply Last reply
    0
    • M Mahjouba

      Hi, I want to change the background of my checkbox, i tried this :

      QCheckBox::indicator{background-color:red;}

      but then the checkbox do not work.

      how can i change the background color without reset all other styling.

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

      @Mahjouba said in Setting background color for QCheckBox::indicator resets all other styling:

      but then the checkbox do not work.

      Hello and welcome.

      In what way "checkbox do not work"?

      without reset all other styling.

      What other styling are you talking about?

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Mahjouba
        wrote on last edited by
        #3

        no checkmark appears anymore when the checkbox is selected.

        the other styling are the color of the text/label.

        JonBJ 1 Reply Last reply
        0
        • M Mahjouba

          no checkmark appears anymore when the checkbox is selected.

          the other styling are the color of the text/label.

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

          @Mahjouba
          And are you setting "the color of the text/label" in stylesheet or in code? The rule is if in code you will lose it if you apply any stylesheet, that's why I ask.

          1 Reply Last reply
          3

          • Login

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