6

I am working on a GUI and I've run into a problem. If I set a button, label, or other widget to have a background color, the tooltip for that widget also takes the same background color. I tried editing the style sheet for the tooltip specifically and setting a different background color but it doesn't work. I also tried editing the palette for the widget but changing the color scheme for the tooltip background or text doesn't work either. Is there another way I can do this? I'd like to have consistency between all my tooltips.

Thanks!

4

1 回答 1

8

一般来说,您可以做这样的事情来设置 aQToolTip的样式。

QToolTip { color: #fff; background-color: #000; border: none; }

当您需要QToolTips专门设置样式时,可以根据它们的父小部件使用以下语法:

ParentWidgetName QToolTip { color: #333; background-color: #1c1c1c; border: none; }

阅读本文将进一步帮助您。

于 2012-12-04T02:41:29.223 回答