[Solved]QToolButton Hover event
-
wrote on 20 Oct 2010, 14:28 last edited by
I'm trying to set a background-color on a QToolButton when hovering another one. Do you know if I can use a hover event or something related to the "hover event" behavior?
Thanks! -
wrote on 20 Oct 2010, 14:31 last edited by
Maybe :hover pseudo state will help you?
-
wrote on 20 Oct 2010, 14:50 last edited by
Don't now if it works with pseudo states, how can I refer to the second QToolButton from the first button's stylesheet?
@button1->setStylesheet(" QToolButton:hover{\n"
" can I change background of another button?}"); @ -
wrote on 20 Oct 2010, 15:19 last edited by
No you can't do it. You can set global app stylesheet or stylesheet on widget containing these buttons with using ids in scopes (id is equal to objectName).
-
wrote on 21 Oct 2010, 11:09 last edited by
Did it old style : on enterEvent( leaveEvent ) for those two buttons emited signals( StartHover and EndHover ) to parent widget were I added some slots that catch those signals and set the styleSheet accordingly
1/5