I am just starting to use QCustomPlot and I added multiple QCustomPlot on the same layout with setOpenGl(true), this leads to a segfault, stack trace:
#1 0x00007ffff66638a6 in QOpenGLContext::makeCurrent(QSurface*) () from /usr/lib/libQt5Gui.so.5
#2 0x000000000042864f in QCPPaintBufferGlFbo::reallocateBuffer (this=0x7fffe1168d30) at qcustomplot.cc:938
938 mGlContext.data()->makeCurrent(mGlContext.data()->surface());
#3 0x00000000004277a3 in QCPAbstractPaintBuffer::setSize (this=0x7fffe1168d30, size=...) at qcustomplot.cc:594
594 reallocateBuffer();
#4 0x0000000000455357 in QCustomPlot::setupPaintBuffers (this=0x7fffe9c8af80) at qcustomplot.cc:14822
14822 mPaintBuffers.at(i)->setSize(viewport().size()); // won't do anything if already correct size
#5 0x000000000045306a in QCustomPlot::replot (this=0x7fffe9c8af80, refreshPriority=QCustomPlot::rpQueuedRefresh) at qcustomplot.cc:14151
14151 setupPaintBuffers();
#6 0x0000000000453d44 in QCustomPlot::resizeEvent (this=0x7fffe9c8af80, event=0x7fffffffc800) at qcustomplot.cc:14478
14478 replot(rpQueuedRefresh); // queued refresh is important here, to prevent painting issues in some contexts (e.g. MDI subwindow)
#7 0x00007ffff6e0134e in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#8 0x00007ffff6db9e0c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#9 0x00007ffff6dc1581 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
If I enable setOpenGl on only the first QCustomPlot it works fine.
I am using an update Arch Linux distro.