PDA

View Full Version : Tooltip has undesired border



lni
1st May 2009, 04:17
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

aamer4yu
1st May 2009, 05:18
Read about the Qt Style sheets in Qt Assistant..
u can limit the hierarchy using "." ">" .
like .QPushButton { ....}

faldzip
1st May 2009, 05:43
I think it should be like this:


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.

lni
1st May 2009, 15:43
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: