[Interest] StyleSheets in children QWidgets

André Somers andre at familiesomers.nl
Thu Feb 23 13:25:08 CET 2012


Op 23-2-2012 13:16, Николай Шатохин schreef:
> So, If I change StyleSheet of CentralWidget then I must change 
> StyleSheets of all children Widgets? So, is it possible to see default 
> stylesheets of widgets? What stylesheet do I must to set to create 
> button with rounded corners and different pictures on click, mouse 
> over, selection, normal and disabled states? And how can I turn off 
> ugly pink selection?
I don't know what you mean by the "ugly pink selection", so please bear 
with me if I'm totally off.

The idea of style sheets is that they are *Cascading*. Hence the C in 
CSS. That means that any stylesheet set higher up the stack will also 
apply to widgets lower in the stack. Having said that, it does not mean 
that all widgets lower in the stack will also be styled. That all 
depends on the selectors that you used. The selectors can be very 
unspecific (perhaps only the class name), but they may also be very 
specific up to the point of referencing a specificly set object name 
and/or other properties.

So, if you don't want widgets further down the stack styled, make sure 
that you are more specific in your use of selectors.

André




More information about the Interest mailing list