Graphics▲
Graphics in Qt 5 is primarily done either through the imperative https:// API, or through Qt’s declarative UI language, Qt Quick, and its scene graph back-end. Qt 5's graphics capabilities also includes support for printing, as well as the loading and saving of various image formats.
2D Graphics with QPainter▲
https:// provides API for drawing vector graphics, text and images onto different surfaces, or https:// instances, such as https://, https://, https://, and https://. The actual drawing happens in the https://'s https://. The software rasterizer and the OpenGL (ES) 2.0 back-ends are the two most important https:// implementations. The raster paint engine is Qt’s software rasterizer, and is used when drawing on a https:// or https://. Its strength over the OpenGL paint engine is its high quality when antialiasing is enabled, and a complete feature set.
-
https:// - Overview over the https:// classes and architecture.
-
https:// - Explains how https://'s coordinate system works.
-
https:// - Explains how https:// performs filling and outlining of vector shapes.
The most important rendering targets for https:// are:
-
https:// - A hardware-independent image representation with direct pixel access. https:// will use the software rasterizer to draw to https:// instances.
-
https:// - A image representation suited for display on screen. https:// will primarily use the software rasterizer to draw to https:// instances.
-
https:// - A paint device to render to the current OpenGL (ES) 2.0 context. https:// will use hardware accellerated OpenGL calls to draw to https:// instances.
-
https:// - A backbuffer for top-level windows. https:// will primarily use the software rasterizer to draw to https:// instances.
-
https:// - A baseclass for pre-Qt Quick user interface classes. https:// will render widgets using a https://.
-
https:// - A painter can also be opened on a https://. This is provided as a convenience, since technically this is no different than using https://.
https:// and related classes are part of the https:// module.
OpenGL and 3D▲
OpenGL is the most widely adopted graphics API for hardware accelerated and 3D graphics, implemented on all desktop platforms and almost every mobile and embedded platform. The Qt library contains a number of classes that help users integrate graphics driven by OpenGL or other graphics API calls into their applications, as well as add-on modules for displaying 3D content.
-
https:// - An overview of how OpenGL integrates with the https:// module.
-
https:// is a widget that allows adding OpenGL scenes into https://-based user interfaces.
-
https:// - How to integrate application-provided graphics commands (OpenGL, Vulkan, Direct3D, etc.) into a Qt Quick scene graph.
-
http:// - The official OpenGL pages.
-
Qt Quick 3D - An add-on module that provides a high-level API for creating 3D content or UIs based on Qt Quick.
-
https:// - An add-on module that provides functionality for near-realtime simulation systems with support for 2D and 3D rendering, in both Qt C++ and Qt Quick applications.
Prior to Qt 5.0, OpenGL support in Qt was handled by the https:// module. This module is still present, but new code should aim to use the new classes in the https:// module. The classes are easily distinguisible based on their names: Classes with the QGL prefix should not be used. Instead, prefer the ones starting with QOpenGL.
Qt Quick Scene Graph▲
Qt Quick 2 introduces an OpenGL (ES) 2.0 scene graph for rendering. It generally improves the performance of Qt Quick 2 significantly compared to the https:///https://-based approach used in earlier versions.
The scene graph is a graphical representation of the Item scene. It can be thought of as a graphical deep copy, an independent structure that contains enough information to render all the items. Once it has been set up, it can be manipulated and rendered independently of the state of the items. On many platforms, the scene graph will even be rendered on a dedicated render thread while the GUI thread is preparing the next frame's state.
The scene graph is used when you import https:// 2.x in your QML file, and use https:// to run it.
-
https:// - Overview of the Qt Quick Scene Graph architecture.
-
https:// - Breakdown of the rendering of each frame.
Qt Quick can be mixed with raw OpenGL rendering by connecting to the signals https://() or https://() which are emitted before and after the Qt Quick scene graph is rendered, respectively. There signals are emitted from the render thread (when applicable), and the connections need to be direct.
Qt Quick can also be rendered using http://. This raster paint engine enables rendering Qt Quick applications on platforms that do not have OpenGL.
Printing▲
Qt supports printing both directly to actual printers, locally or on the network, as well as producing PDF output. How to do printing with Qt is described in detail on the https:// page.
Images▲
Qt supports convenient reading, writing, and manipulating of images through the https:// class. In addition, for more fine grained control of how images are loaded or saved, you can use the https:// and https:// classes respectively. To add support for additional image formats, outside of the ones provided by Qt, you can create image format plugins by using https:// and https://.
See the https:// page for more information.
See Also▲
See also https://


