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 .
使用
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
去構建工程,默認包括 Qt GUI。要禁用 Qt GUI,添加以下行到
.pro
文件:
QT -= gui
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: