How to Style Hover on QMenu's Tear-off Area?
-
I'm attempting to customize the hover style for the tear-off area of a QMenu using the following CSS, but it seems to have no effect:
QMenu::tearoff:hover { color: red; }Does anyone know why this CSS doesn't work, or how to properly style the hover state for a tear-off area?
Thanks for any help! -
Sorry for the late reply—I actually forgot I had posted on the forum! I've now resolved the style sheet issue, and it's working as expected. Here's the snippet I used:
QMenu::tearoff { background-color: #1A1A1A; height: 12px; border: none; background-image: url(linkIcons:menuLine2.png);} QMenu::tearoff:selected { background-color: #4D4D4D; height: 12px;}
-
Hi and welcome to devnet,
You should provide a minimal compilable example that shows your issue.
Note that I am not sure that the tear off supports the hover state. -
P Pl45m4 referenced this topic on
-
Sorry for the late reply—I actually forgot I had posted on the forum! I've now resolved the style sheet issue, and it's working as expected. Here's the snippet I used:
QMenu::tearoff { background-color: #1A1A1A; height: 12px; border: none; background-image: url(linkIcons:menuLine2.png);} QMenu::tearoff:selected { background-color: #4D4D4D; height: 12px;}
-
S SGaist has marked this topic as solved on