> Thanks that worked great! But I'm having another problem now when I > hover a QCheckBox its background is not transparent any more. Is there > something I can set on the something that this is not happening. > > See the 2 attached screenshots (I'm on OS-X if that matters) > > Tom
Hi Tom, What you see is that the checkbox enters the hover state, which will draw a rectangle for the entire background with a color slightly lighter than the root windows background, as defined in the toplevels palette. This is only the case for the cleanlooks style though. Don't see why you are using that on Mac OS X? Here are some things you could try: * Instead of reimplementing the paintEvent(), tell the toplevel widget that it should paint the background using a gradient. This is done by setting a different palette on the toplevel widget. You then need to set the gradient to be defined in device coordinate mode use height / width relative to 1. * You could try to change the palette of the checkbox to have QColor.transparent in its background, but depending on how the actual hovering is implemented, this may have no effect. * Disable hover events on the checkboxes by setting Qt.WidgetAttribute.WA_Hover on the them. This might be overridden by the style, I don't remember. * When you're styling your own widgets you should style them fully, aka. reimplement QStyle or one of the subclasses and do all the relevant changes, but this is a pretty big task. Styling via stylesheets is a lot simpler, but its slightly more strict. best regards, Gunnar _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
