PDA

View Full Version : Help with incremental painting...



vidya
25th January 2014, 00:11
Hello all...I am using qwt 6.0.1 on linux and qt 4.7..I am doing real time plotting using incremental painting as shown in oscilloscope example..But in my case i am having many qwtplot widgets for plotting..My layout is in such a way that only 1 plotwidget is visible at a time.I use page up and page down button controls to go to the next plot widget.i.e.,I am adding only 1 plotwidget to the layout and hiding the remaining plot widgets..when i do page down,i will show the next plot widget and hide the remaning widgets..The problem i am facing is i am not able to do painting on the hidden plot widgets..i am calling a function every 1 second to plot on all the plotwidgets..but the widgets which were hidden are not getting painted..only the current visible widget is getting painted..When i use page up/down button and go to the other plot widget,then from that point of time painting is started on the current visible widget..my axis range is fixed and i should be able to see the plot right from the starting time i.e., from lower limit of scale..But i am not able to update the plot during the time it was hidden..how to enable painting on plotwidgets which are hidden?

Uwe
26th January 2014, 09:58
You can't paint something to a hidden widget - you need to have an implementation for the full repaint following the show event.

If your application doesn't store any samples after drawing them with the direct painter, you don't have a working replot operation. As long as the plot canvas has exactly the same size in hidden and visible state you could try to enable the backing store of the canvas ( QwtPlotCanvas::BackingStore ). Then show/repaint might work - but as soon as you have a resize of the canvas you need a working replot.

Uwe