[Qt-interest] Tooltip inheriting widget style - how to prevent ?

Stephen Collyer scollyer at netspinner.co.uk
Tue Apr 27 16:52:28 CEST 2010


On 27 April 2010 14:31, J-P Nurmi <jpnurmi at gmail.com> wrote:

> On Tue, Apr 27, 2010 at 4:22 PM, Stephen Collyer
> );
> >
> > The tooltip for play_button inherits the style set for play_button.
> >
> > Can anyone suggest a straightforward way to prevent this ?
> >
>
> Hi,
>
> You can use appropriate selectors:
> http://doc.qt.nokia.com/4.6/stylesheet-syntax.html#selector-types
>

Thanks. That's exactly what I was looking for. I now bracket the style
string with:

style.append(".QPushButton {");
 ...
style.append("}");

which limits the style to the QPushButton class.

It would be nice to have a "top level class only" selector, though, to
remove the need for duplication of the class name.

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100427/b14872e8/attachment.html 


More information about the Qt-interest-old mailing list