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 文件 國際色彩聯盟許可