Jean-Marc Lasgouttes wrote:
you check whether 'val' actually changed value?
Alfredo> It doesn't work. The problem is that the signal is emmited Alfredo> when the value has been just changed.
You can also cache the value somewhere.
qt seems to emit only when the value is actually changed (good). The problem
is that on update, we redraw and then call to adjust the scrollbar, with a
new value, and this calls an update again.
Seems that the right thing then might be to not bother with the redraw. Just adjust the scrollbar and let the redraw follow?
How about doing the redraw only for xforms then?
The main problem right now with scrolling is that fitCursor adjusts the
scrollbar, that calls an update under qt but not under xforms.
So for adjusting qt without touching xforms we need to set the scrollbar value without invoking the signal. Something like the attached works (altough it is not so nice maybe). Alternatively, we can just disconnect the signal before setValue and reconnect it after. Other ideas welcomed.
It just seems strange to do a lot of work to avoid automatic drawing. Drawing
is needed at this point anyway, so let it draw and just loose the explicit
drawing that only xforms need.
Helge Hafting
