I just tried this:
Qt Code:
  1. void SomeWidget :: enterEvent (QEvent *) {
  2. setStyleSheet ("background-color: red");
  3. }
  4.  
  5. void SomeWidget :: leaveEvent (QEvent *) {
  6. setStyleSheet (QString());
  7. }
To copy to clipboard, switch view to plain text mode 
The widget's background color is not set, its children's background colours are!

How do I prevent the stylesheet from being inherited?

I've been trying to use the backgroundRole property instead -- to no effect. I need a solution in stylesheets for other reasons.

Thanks a lot, the folks on this forum have been a great help so far.