Qt rendering using OpenGL

I am working on a QML application for an embedded platform that includes a GridView widget containing images. It is important for me that scrolling through the GridView is smooth and does not load the processor. Can I expect Qt to use OpenGL to render a GridView?

+7
source share
3 answers

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.

+5
source

Depending on the platform used

 QApplication::setGraphicsSystem(QLatin1String("opengl")); 

or (Symbian)

 QApplication::setGraphicsSystem(QLatin1String("openvg")); 

before you instantiate the QApplication object.

+3
source

By default, Qt does not use the OpenGL rendering backend. You can use it using QGlWidget. In your case, since you want to use the stock widget, you can set the rendering backend as a command line parameter:

 <binary name> -graphicssystem opengl 
+2
source

All Articles