1 Attachment(s)
Tooltip has undesired border
Hi,
I do toolButton->setStyleSheet( "border: 2px solid red;" ) to highlight a tool button. The button contains a QAction that has tooltip. When hover over the button, the tool tip has same border as the button, which is not desired. What can I do so that the tooltip doesn't inherit the button's border? Please see the attachment.
Thanks
Re: Tooltip has undesired border
Read about the Qt Style sheets in Qt Assistant..
u can limit the hierarchy using "." ">" .
like .QPushButton { ....}
Re: Tooltip has undesired border
I think it should be like this:
Code:
toolButton->setStyleSheet("QToolButton { border: 2px solid red; }");
P.S. But, as aamer4yu said, few minutes with style sheet reference in Qt Assistant is highly recommended.
Re: Tooltip has undesired border
Thank you both! That works great!
I am surprised to find also that when I setStatusTip in the QAction, it automatically finds the QStatusBar in the QMainWindow and display it there, although the QAction is in QMdiSubWindow many levels down the widget tree. Was thinking how I can let the QAction know where the QStatusBar is.....
:rolleyes: