QCustomPlot Discussion and Comments

Auto replot disablingReturn to overview

I wanted to know if the auto replot function at resize and other event will be available as an option in a future release ?

Currently i'm creating my own QCustomPlot but it may be useful for other ?

QCustomAutoPlot::QCustomAutoPlot(QWidget *parent):QCustomPlot(parent)
    _enableAutoReplot = true;

void QCustomAutoPlot::resizeEvent(QResizeEvent *event)
    // resize and repaint the buffer:

    if( _enableAutoReplot)
        replot(rpQueuedRefresh); // queued refresh is important here, to prevent painting issues in some contexts (e.g. MDI subwindow)

i thought replot just set up all the information it needs to plot and the actual plotting was done in paintEvent( which is already done on resize). i think as long as you had already called replot, it doesnt matter when you resize.

I can add this as a plotting hint in the future.
I'm interested in why you would want this though?

@Ian: in the paint event only the buffer QPixmap of the plot is drawn to the widget surface – a very fast operation, because the paintEvent may be called many times without the plot really changing. The actual drawing of the axes, graphs, etc. to the buffer happens in the replot method.

I need that because I'm displaying my plot in 2 types of layout :
- a QSplitter
- a custom QLayout

When i'm changing my representation i need to remove the plot from the QSplitter.
Everytime I was removing a plot all the other plot where reploting because of the resizeEvent.
This was a real bottleneck since I'm dealing with hundreds of plot with more than 100 000 samples by plot.
The removal first took more than 5 seconds , then with auto replot disabled in took 109 ms.