summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/src/qtgui.qdoc
blob: f68ccbb6a867fbe689013b1cb6ae33959f2f11d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.  Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \module QtGui
    \title Qt GUI C++ API
    \ingroup modules

    \brief The Qt GUI module provides the basic enablers for graphical
    applications written with Qt.

    The Qt GUI module provides classes for windowing system
    integration, event handling, OpenGL and OpenGL ES integration, 2D
    graphics, imaging, fonts and typography. These classes are used
    internally by Qt's user interface technologies and can also be
    used directly, for instance to write applications using low-level
    OpenGL ES graphics APIs.

    To include the definitions of the module's classes, use the
    following directive:

    \snippet code/doc_src_qtgui.pro 0

    See the \l {Qt GUI} page for more details.

*/

/*!
    \page qtgui-index.html
    \title Qt GUI

    The Qt GUI module provides classes for windowing system
    integration, event handling, OpenGL and OpenGL ES integration, 2D
    graphics, basic imaging, fonts and text. These classes are used
    internally by Qt's user interface technologies and can also be
    used directly, for instance to write applications using low-level
    OpenGL ES graphics APIs.

    For application developers writing user interfaces, Qt provides
    higher level API's, like Qt Quick, that are much more suitable
    than the enablers found in the Qt GUI module. 

    \section1 Getting started

    To include the definitions of the module's classes, use the
    following directive:

    \snippet code/doc_src_qtgui.pro 0



    \section1 Application Windows

    The most important classes in the Qt GUI module are
    QGuiApplication and QWindow. A Qt application that wants to show
    content on screen, will need to make use of these. QGuiApplication
    contains the main event loop, where all events from the window
    system and other sources are processed and dispatched. It also
    handles the application's initialization and finalization.

    The \l QWindow class represents a window in the underlying
    windowing system. It provides a number of virtual functions to
    handle events (\l {QEvent}) from the windowing system, such as
    touch-input, exposure, focus, key strokes and geometry changes.



    \section1 2D Graphics

    The Qt GUI module contains classes for 2D graphics, imaging, fonts
    and advanced typography.

    A \l QWindow created with the surface type \l
    {QSurface::RasterSurface} can be used in combination with \l
    {QBackingStore} and \l {QPainter}, Qt's highly optimized 2D vector
    graphics API. QPainter supports drawing lines, polygons, vector
    paths, images and text. For more information, see \l{Paint
    System} and \l {Raster Window Example}.

    Qt can load and save images using the \l QImage and \l QPixmap
    classes. By default, Qt supports the most common image formats
    including JPEG and PNG among others. Users can add support for
    additional formats via the \l QImageIOPlugin class. For more
    information, see \l {Reading and Writing Image Files}

    Typography in Qt is done with \l QTextDocument which uses the \l
    QPainter API in combination with Qt's font classes, primarily
    QFont. Applications that prefer more low-level APIs  to text
    and font handling, classes like QRawFont and QGlyphRun can be
    used.



    \section1 OpenGL and OpenGL ES integration

    QWindow supports rendering using desktop OpenGL, OpenGL ES 1.1 and
    OpenGL ES 2.0, depending on what the platform supports. OpenGL
    rendering is enabled by setting the QWindow's surface type to
    QSurface::OpenGLSurface, choosing the format attributes with
    QSurfaceFormat, and then creating a QOpenGLContext to manage
    the native OpenGL context. In addition, Qt has QOpenGLPaintDevice,
    which enables the use of OpenGL accelerated QPainter rendering, as well as
    convenience classes that simplify the writing of OpenGL code and hides the
    complexities of extension handling and the differences between OpenGL ES 2
    and desktop OpenGL. The convenience classes include QOpenGLFunctions that
    lets an application use all the OpenGL ES 2 functions on desktop OpenGL
    without having to manually resolve the OpenGL function pointers and some
    classes that wrap native OpenGL resources in a simpler Qt API:
    QOpenGLBuffer, QOpenGLFramebufferObject, and QOpenGLShaderProgram.

    For more information, see the \l {OpenGL Window Example}.

    The Qt GUI module also contains a few math classes to aid with the
    most common mathmatical operations related to 3D graphics. These
    classes include \l {QMatrix4x4}, \l {QVector4D} and \l {QQuaternion}

    A \l {QWindow} created with the \l {QSurface::OpenGLSurface} can
    be used in combination with \l QPainter and \l QOpenGLPaintDevice
    to have OpenGL hardware accellerated 2D graphics, by sacrificing
    some of the visual quality.



    \section1 Qt GUI prior to Qt 5.0

    Prior to Qt 5.0, the Qt GUI library was the monolithic container
    for all things relating to graphical user interfaces in Qt, and
    included the Qt widget set, the item views, the graphics view
    framework and also printing. Starting Qt 5, these classes have
    been moved to the QtWidgets library. Printing has been
    moved to the QtPrintSupport library.  Please note that these
    libraries can be excluded from a Qt installation.

    QtGui now contains only a small set of enablers, which are generally
    useful for all graphical applications.

    \section1 Drag and Drop

    More info in \l{Drag and Drop}

    \section1 Reference
    \list
    \li \l{Qt GUI C++ API}
        \list
        \li \l{Event Classes}
        \li \l{Painting Classes}
        \li \l{Rendering in 3D}
        \endlist
    \endlist
 */

/*!
    \group events
    \title Event Classes
    \ingroup groups

    \brief Classes that provide UI and input events.
*/