With Qt5 you will find the addition of new technologies that will make your development much easier.
Qt5 is backwards compatible, that means you can run your Qt 4.8 applications, But that doesn't mean they will have the best performance, sometimes it is better to do a porting to use the newest features.
Qt5, has two options to paint components into the screen. Painting in Qt 5 is primarily done either with:
QPainter
As this document mentions Qt5GraphicsOverview | Qt Wiki | Qt Project The Qpainter engine uses software to paint, and is used when drawing Qimages or Qwidgets. Its advantage over OpenGL is the high quality when antialiasing is enabled, and a complete feature set.
The Qpainter can use an OpenGL engine, but as the document mentions it is more suceptible to state changes. And has to be used carefully.
QML & Scene Graph.
All visual QML items are rendered using the scene graph, a low-level, high-performance rendering stack, closely tied to OpenGL.
Qt Quick 2 makes use of a dedicated scene graph based on OpenGL ES 2.0 or OpenGL 2.0 for its rendering. Using a scene graph for graphics rather than the traditional imperative painting systems (QPainter and similar), means the scene to be rendered can be retained between frames and the complete set of primitives to render is known before rendering starts. This opens up for a number of optimizations, such as batch rendering to minimize state changes and discarding obscured primitives.
The QML scene graph is a new back-end for QML in Qt 5, and is based on OpenGL. It generally improves the performance of QML significantly over the QPainter-based back-end used in Qt 4. It achieves better performance in a number of ways:
We have tested on i.MX6 Both options, having the best results using QML Qtquick2 elements. When we tried using QtPainter via Widgets we face the problem that if not using a windowing system like X11 or Wayland the painter wont work well and will only show the QtGLWidget.
With QML scene graph we are able to have an OpenGL element and a Qt element on the same environment, and there is an easy way to communicate one with the other and share variables. Please look at the example results here: I.MX6 scene graph Qt5 - YouTube
And the great advantage, the sceneGraph is all accelerated via OpenGL.
FranciscoCarrillo, can you please move this document to the public i.MX Community so that your document there does not point to a doc in a place that external members cannot access? And then add a post to the below public discussion that reported this problem?
Linked article says "Access to this place or content is restricted..."
This question is Not Answered.(Mark as assumed answered)
stephenlangstaff Jul 12, 2013 2:43 AM
I'm seeing "Access to this place or content is restricted. If you think this is a mistake, please contact your administrator or the person who directed you here." when trying to access https://community.freescale.com/docs/DOC-94234, pointed to from QT5 Demo Errors on EGLFS.
Thanks,
Grant
hello
I am porting to iMX6 with Qt5.1 a large application, originally based on Qt4.7 and running on iMX35.
My legacy application has lots of 2D drawing based on the QPainter API.
I was hoping to replace QWidget with QGLWidget and get hardware accelerated QPainter API; it looks like this is not the case.
I stay with QPainter I only get software rendering like with Qt 4.7
If I want hardware accelerated 2D rendering then I have to rewrite all drawing code using the gl API.
Is my understanding correct?
Fabio