QCustomPlot Discussion and Comments

replot if Qcustomplot is actually not shownReturn to overview

Hello together!

I actually have a gui application which uses a lot of QCustomPlot instances in parallel. However, most of them are not visible at the same time (p.ex. on Tab-Pages which are currently hidden).
The application does some measurement and each time when new data arrives I call replot for all the QCustomPlots which use this data. Now I was questioning myself what happens if a replot is called for a QCustomplot which is not visible at the moment. Does the QCustomPlot itself recognise this and delay the replot until the next show event happens?
Or to ask the other way round: could I save time if I only called replot on those QCustomPlots where isVisible()==true ?

Thanks in advance,


Replots are performed independently of whether the widget is visible or not (because a replot has major side effects on the plot itself, e.g. axis rect dimensions for automatic margins, tracer positions, etc. etc., which the programmer must be able to trust and even execute if the QCustomPlot is maybe never meant to be shown, in the case of backend-plotting). Repaints (blitting the paint buffer on the widget surface) are not performed. However replots are usually more costly than repaints.

So yes, if you know you don't actually need that replot now, don't call it.