I have a QSlider that is a child of a widget that does 3D drawing. When I drag the slider handle artifacts of where the handle has been are left behind (the handle is "smeared"). How can I fix this?
I have a QSlider that is a child of a widget that does 3D drawing. When I drag the slider handle artifacts of where the handle has been are left behind (the handle is "smeared"). How can I fix this?
I guess your slider is on a QGLWidget or maybe some other self drawing viewport.
The effect is caused by the fact that you are not updating that widget when you move the slider.
One easy way would be to connect the slider valueChanged() signal to the update() slot of your QGLWidget.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
TheClassic (9th June 2011)
Thanks, that makes sense. Its not a QGLWidget, but its something similar that does OpenGL drawing in a seperate thread. I have a second question which I think has the same answer.
I have a widget that serves only as a container for a few child widgets (on top of this same 3D . I don't want to draw this container widget (just its children), and have tried overriding the paintEvent with an empty implementation, however it still appears to be drawing the widget, or at least the 3D drawing widget underneath is obscured by it. Is this the same problem? I found one work around for this is to just use a QObject to contain the other widgets instead, although it obviously requires me to reimplement things like move(), hide(), etc
Kind of.Is this the same problem?
You widget which is on top of your 3D widget has no information about the 3D stuff being rendered, so it can't use that information to behave as transparent.
Your workaround sounds a good way to do it.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks