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

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

Scheduled Pinned Locked Moved General and Desktop
stylesheetcheckbox
2 Posts 2 Posters 1.7k 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.
  • J Offline
    J Offline
    Jakob
    wrote on 4 Jun 2015, 11:17 last edited by
    #1

    I have a QCheckbox appearing on a form with a non-white background, but want the indicator to appear with a white background. My first guess was that this could be achieved inside my application stylesheet by adding:

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

    However, this completely ruins the tickbox: the depth-effect is gone, and also no checkmark appears anymore when the checkbox is selected.

    What am I doing wrong?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Jun 2015, 23:30 last edited by
      #2

      Hi,

      Nothing really wrong, QWidget using style sheets are rendered by a special style. With style sheets you can customize things that might not be done with the native style.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      4 Jun 2015, 11:17

      • Login

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