I ran into the same problem.
QApplication::setGraphicsSystem(QLatin1String("opengl"));
Do not work for me. Therefore, I install OGWidget as a viewport:
QDeclarativeView mainwindow; mainwindow.setSource(QUrl::fromLocalFile("./qml/app.qml")); QGLFormat format = QGLFormat(QGL::DirectRendering); // you can play with other rendering formats like DoubleBuffer or SimpleBuffer format.setSampleBuffers(false); QGLWidget *glWidget = new QGLWidget(format); glWidget->setAutoFillBackground(false); mainwindow.setViewport(glWidget);
and don't forget to add opengl to the * .pro file.
avida
source share