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 but can also be used directly, for example to write applications using low-level OpenGL ES graphics APIs.

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

使用模块

Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .

构建采用 CMake

使用 find_package() command to locate the needed module component in the Qt6 包:

find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
					

更多细节,见 构建采用 CMake 概述。

采用 qmake 构建

若使用 qmake 去构建工程,默认包括 Qt GUI。要禁用 Qt GUI,添加以下行到 .pro 文件:

QT -= gui
					

文章和指南

参考

Module Evolution

Qt GUI 的变化 lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.

许可和归属

Qt GUI 在商业许可下是可用的来自 Qt 公司 . In addition, it is available under free software licenses: The GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

Furthermore, Qt GUI in Qt 6.5.1 may contain third-party modules under following permissive licenses:

用于新字体的 Adobe Glyph 列表,第 1.7 版 BSD 3 条款新 (或修订) 许可
来自 FreeType 2 的抗锯齿光栅化器 FreeType 工程许可或仅 GNU GPL (一般公共许可) 第 2.0 版
Bitstream Vera字体,第 1.10 版 Bitstream Vera 字体许可
Cocoa 平台插件 BSD 3 条款新 (或修订) 许可
DejaVu 字体,第 2.37 版 Bitstream Vera 字体许可
Freetype 2 - BDF (位图分发格式) 支持 MIT 许可
Freetype 2 - PCF (便携式编译格式) 支持 MIT 许可和 MIT 开放组变体
Freetype 2 - zlib zlib 许可
Freetype 2, version 2.13.0 FreeType 工程许可或仅 GNU GPL (一般公共许可) 第 2.0 版
HarfBuzz-NG, version 7.2.0 MIT 许可
IAccessible2 IDL 规范,第 1.3.0 版 BSD 3 条款新 (或修订) 许可
LibJPEG-turbo, version 2.1.5 独立 JPEG 组许可和 BSD 3 条款新 (或修订) 许可及 zlib 许可
LibPNG, version 1.6.39 libpng 许可和 PNG 参考库,第 2 版
MD4C, version 0.4.8 MIT 许可
Android 本机风格 Apache 许可 2.0
OpenGL ES 2 头,修订版 27673 MIT 许可
OpenGL 头,修订版 27684 MIT 许可
Pixman,第 0.17.12 版 MIT 许可
平滑比例缩放算法 BSD 2 条款简化许可和 Imlib2 许可
Vulkan API Registry, version 1.3.223 Apache License 2.0 or MIT License
Vulkan Memory Allocator, version 3.0.1 MIT 许可
WebGradients MIT 许可
Wintab API LCS 电报许可
X 服务器帮手 X11 许可和历史权限通知及免责声明
XCB-XInput MIT 许可
sRGB 颜色 profile icc 文件 国际色彩联盟许可