To get its performance, QCustomPlot uses pixmap caching of expensive objects in the plot, especially texts. So even if I got rid of the overall paint buffer, there are still individual QPixmaps around for caching. Up to Qt 4.8 this was great, because QPixmap was a device pixmap and supported sub-pixel antialiasing, all was great. Then the Qt devs decided to change that and haven't fixed it since:
https://bugreports.qt.io/browse/QTBUG-22334
Very unfortunate for all widgets out there that need to do expensive painting and would like to (or have to) cache some of that in pixmaps :/.
The reason to have a paint buffer pixmap in the paint event and only draw the scene on that is to avoid flicker for Qt 4.6 and Qt 4.7 (http://doc.qt.digia.com/qq/qq06-flicker-free.html). Back in the time, QWidget painters would directly show the drawn lines, and not perform double buffering automatically in their ::end() call. So one had to take care of that, which, since QPixmaps supported sub-pixel antialiasing, wasn't a big deal.
Anyway, I'll check out whether removing (conditionally for Qt >= 4.8) the explicit double-buffering improves anything. At least, it would give sub-pixel antialiasing of texts if text caching is disabled (QCustomPlot::setPlottingHint(QCP::phCacheLabels, false)
), at the expense of performance.