anr78
25th October 2011, 08:28
In my QMenu I've added checkable QActions, and I need to style them a bit. As a test I tried:
"QMenu::indicator:non-exclusive:unchecked {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
"QMenu::indicator:non-exclusive:unchecked:selected {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
"QMenu::indicator:non-exclusive:checked {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
"QMenu::indicator:non-exclusive:checked:selected {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
;
The png:
7032
When I run my code, the color of the checkmark seems to be set from my png, but the background is grey. I thought it would use my entire png. How do I style the background?
If I don't apply this stylesheet, the color of the checkable region follows my QMenu stylesheet:
"QMenu::item::enabled {"
"color: white;"
"background-color: rgb(66,66,66);"
"selection-color: rgb(66,66,66);"
"selection-background-color: white;"
"}"
What I'm basically trying to do is make the color and background of the checkbox follow item colors.
"QMenu::indicator:non-exclusive:unchecked {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
"QMenu::indicator:non-exclusive:unchecked:selected {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
"QMenu::indicator:non-exclusive:checked {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
"QMenu::indicator:non-exclusive:checked:selected {"
"image: url(:/images/icons/checkmark_grey.png);"
"}"
;
The png:
7032
When I run my code, the color of the checkmark seems to be set from my png, but the background is grey. I thought it would use my entire png. How do I style the background?
If I don't apply this stylesheet, the color of the checkable region follows my QMenu stylesheet:
"QMenu::item::enabled {"
"color: white;"
"background-color: rgb(66,66,66);"
"selection-color: rgb(66,66,66);"
"selection-background-color: white;"
"}"
What I'm basically trying to do is make the color and background of the checkbox follow item colors.