Hi Gunnar, > 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? > Well it was only to try it out :-) The library I'm working on is supposed to run on every platform.
> 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. Will give this a try. > > * 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. > Well the result is less appealing than what you get when doing it manually. I only tried to background-color on the QLineEdit-fields and the result is different than the one you get by setting a background color using a palette (the background-color is drawn widget beyond the bounds a few pixels). What I'm currently implementing in my lib is a styleing mechanism like you provide it with CSS and I'm falling back to QWidget#setStylesheet() where the result is good enough (e.g. font-definition) but reimplement when it doesn't (e.g the background-color). I'll try the style-definition. Another thing I noticed is that QList and QTable don't support gradient IIRC. After the styling is finished we are working on Declarative UI and an Application model (we'll most likely adopt the one the Eclipse E4 is going to have) this would make writing RCP applications using QT-Jambi a piece of cake. Tom _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
