PDA

View Full Version : How to stop QwtPlot::drawItems when moving scroll bar



lwz
5th March 2014, 12:27
we have several curves attached one plot, which is inside a QScrollArea. When moving the slider , Qt run QwtPlot::drawItems repeately . How can I stop it ?

lwz
6th March 2014, 01:11
As the drawitems takes some time , it doesn't response quick enough when moving the slider.

Uwe
6th March 2014, 07:44
Putting QwtPlot to a QScrollArea is usually not a good idea When zooming in deep with a scroll area the plot widget gets huge in size:



memory issues: e.g think of the backing store of the canvas !
performance also might slow down heavily as you disable all Qwt drawing optimizations and you will run into QPainter bottlenecks


Using scrollbars like in the realtime example ( zoom in and you see them ) is preferable

But concerning your question: the plot canvas has a backing store ( at least if you didn't disable it ) and I don't see why scrolling a plot inside a QScrollArea should be a reason for not using it, as it only gets invalidated:



resize event for the canvas
replot from the application side ( disable the auto replot feature to be sure ).


Uwe

lwz
6th March 2014, 09:20
oh,I have the backing store disabled. Now it works better .
Thanks