views:

168

answers:

1

I try to style a QScrollBar via a custom QStyle but if i draw nothing in drawComplexControl for the QScrollBar, the required space for the scrollbar on the parent widget is painted black. If i do the same with, eg a QToolButton simply the toolbutton is not painted but there is no black rect on the widget. That is what i would expect. But what's the difference to the QScrollBar?

+2  A: 

I figured out the problem. QScrollBar has Qt::WA_OpaquePaintEvent attribute set by default. If it is reset, drawing behaves like expected.

Buuuh