Qt Quick 模塊是用於編寫 QML 應用程序的標準庫。而 Qt QML 模塊提供 QML 引擎和語言基礎設施,Qt Quick 模塊提供采用 QML 創建用戶界麵的所有必要基本類型。它提供視覺畫布,包括用於創建 動畫視覺組件、接收用戶輸入、創建數據模型 視圖、及延遲對象實例化的類型。
Qt Quick 模塊提供 QML API , which supplies QML types for creating user interfaces with the QML language, and a C++ API 為采用 C++ 代碼擴展 QML 應用程序。
注意: 一套基於 Qt Quick 的 UI 控件也可用於創建用戶界麵。見 Qt Quick Controls 瞭解更多信息。
If you're new to QML and Qt Quick, please see QML 應用程序 瞭解編寫 QML 應用程序的介紹。
The QML types of the module are available through the
QtQuick
導入。要使用類型,添加以下 import 語句到 .qml 文件:
import QtQuick
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 Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
更多細節,見 構建采用 CMake 概述。
To configure the module for building with qmake, add the module as a value of the
QT
variable in the project's .pro file:
QT += quick
Qt Quick provides everything you need to create a rich application with a fluid and dynamic user interface. It enables you to build user interfaces around the behavior of user interface components and how they connect with one another, and it provides a visual canvas with its own coordinate system and rendering engine. Animation and transition effects are first class concepts in Qt Quick, and you can add visual effects through specialized components for particle and shader effects.
When using the Qt Quick module, you will need to know how to write QML applications using the QML language. In particular, QML Basics and QML Essentials from the QML 應用程序 頁麵。
要瞭解使用 QML 語言的更多有關信息,見 Qt QML 模塊文檔編製。
用於編寫 QML 應用程序的進一步信息:
QtQuick
import
Qt Quick 在商業許可下是可用的來自 Qt 公司 。此外,它在自由軟件許可下也是可用的。從 Qt 5.4 起,這些自由軟件許可是 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。