Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtopengl-index.qdoc
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \page qtopengl-index.html
6 \title Qt OpenGL
7 \brief The Qt OpenGL module offers classes that make it easy to
8 use OpenGL in Qt applications.
9
10
11 Qt has two main approaches to UI development: \l[QtQuick]{Qt Quick} and
12 \l{Qt Widgets}. They exist to support different types of user
13 interfaces, and build on separate graphics engines that have been
14 optimized for each of these types.
15
16 It is possible to combine code written in the OpenGL graphics API
17 with both of these user interface types in Qt. This can be useful
18 when the application has its own OpenGL-dependent code, or when it
19 is integrating with a third-party OpenGL-based renderer.
20
21 The Qt OpenGL module contains convenience classes to make this type of
22 integration easier and faster.
23
24 \section1 Qt OpenGL and Qt Widgets
25
26 \l{Qt Widgets} is typically rendered by a highly optimized and accurate
27 software rasterizer, and the final content reproduced on screen using a
28 method appropriate for the platform where the application is running.
29
30 But it is also possible to combine \l{Qt Widgets} with OpenGL. The main entry
31 point for this is the \l{QOpenGLWidget} class. This class can be used to
32 enable OpenGL rendering for a certain part of the widget tree, and the
33 classes in the Qt OpenGL module can be used to facilitate any application-side
34 OpenGL code.
35
36 \section1 Qt OpenGL and Qt Quick
37
38 \l[QtQuick]{Qt Quick} is optimized for hardware-accelerated rendering. By default,
39 it will be built on the low-level graphics API most appropriate for the
40 target platform.
41
42 For instance, it will default to \c Direct3D on Windows, whereas on macOS,
43 it will default to \c Metal. But it is also possible to manually
44 select OpenGL as the active graphics API on platforms where this is supported.
45
46 For more details on enabling OpenGL with \l[QtQuick]{Qt Quick}, see
47 \l{Rendering via the Qt Rendering Hardware Interface}{scenegraph renderer documentation}.
48
49 \section1 Using the Module
50
51 \include {module-use.qdocinc} {using the c++ api}
52
53 \section2 Building with CMake
54
55 \include {module-use.qdocinc} {building with cmake} {OpenGL}
56
57 \section2 Building with qmake
58
59 \include {module-use.qdocinc} {building_with_qmake} {opengl}
60
61 \section1 Examples
62
63 \list
64 \li \l {Qt OpenGL Examples}
65 \endlist
66
67 \section1 Reference
68
69 \list
70 \li \l {Qt OpenGL C++ Classes} {C++ Classes}
71 \endlist
72
73 \section1 Module Evolution
74 \l{Changes to Qt OpenGL} lists important changes in the module API
75 and functionality that were done for the Qt 6 series of Qt.
76
77 \section1 Licenses and Trademarks
78
79 The Qt OpenGL module is available under commercial licenses from
80 \l{The Qt Company}. In addition, it is available under free software
81 licenses:
82 The \l{GNU Lesser General Public License, version 3}, or
83 the \l{GNU General Public License, version 2}.
84 See \l{Qt Licensing} for further details.
85
86 OpenGL\reg is a trademark of Silicon Graphics, Inc. in
87 the United States and other countries.
88*/