I am going to answer and answer my question. This is not optimal, but that is exactly how I ran into the problem.
Instead
ui.graphicsView->setViewport(new MyGLWidget(QGLFormat(QGL::DoubleBuffer)));
I have this instead:
ui.graphicsView->setViewport(new QGLWidget(new CustomContext(QGLFormat(QGL::SampleBuffers))));
CustomContext is a class derived from QGLContext. I overridden the create element, for example:
virtual bool create(const QGLContext *shareContext = 0) { if(QGLContext::create(shareContext)) { makeCurrent(); doneCurrent(); return true; } return false; }
I do not think that this is the best way to do this, but it is better than an alternative to the lack of a specific initialization stage. I would still be happy if someone left a better answer!
source share