Qt Quick Controls 提供可以用於構建 Qt Quick 完整界麵的一套控件。模塊在 Qt 5.7 引入。
Qt Quick Controls comes with a selection of customizable styles. See 風格化 Qt Quick Controls 瞭解更多細節。
The QML types of the module are available through the
QtQuick.Controls
導入。要使用類型,添加以下 import 語句到 .qml 文件:
import QtQuick.Controls
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 QuickControls2)
target_link_libraries(mytarget PRIVATE Qt6::QuickControls2)
更多細節,見 構建采用 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 += quickcontrols2
The
Qt Image Formats
模塊是推薦的,但不要求。它提供支持為
.webp
格式用於
想象風格
.
Qt Quick Controls 2.0 was introduced in Qt 5.7. Subsequent minor Qt releases increment the import version of the Qt Quick Controls modules by one, until Qt 5.12, where the import versions match Qt's minor version.
In Qt 6, both the major and minor versions match, and version numbers may be omitted from imports in QML. If the version is omitted, the latest version will be used.
The experimental Qt Labs modules use import version 1.0.
Qt
|
QtQuick
|
QtQuick.Controls
,
QtQuick.Controls.Material
,
QtQuick.Controls.Universal
,
QtQuick.Templates
|
Qt.labs.platform
|
|---|---|---|---|
| 5.7 | 2.7 | 2.0 | 1.0 |
| 5.8 | 2.8 | 2.1 | 1.0 |
| 5.9 | 2.9 | 2.2 | 1.0 |
| 5.10 | 2.10 | 2.3 | 1.0 |
| 5.11 | 2.11 | 2.4 | 1.0 |
| 5.12 | 2.12 | 2.12 | 1.0 |
| 6.0 | 6.0 | 6.0 | 1.0 |
| ... | ... | ... | ... |
Qt Quick Controls was originally written with touch interfaces as the primary focus. While it is already possible to develop desktop interfaces, work is ongoing to provide a more native look and feel.
Changes to Qt Quick Controls lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.
Qt Quick Controls 在商業許可下是可用的來自 Qt 公司 。此外,它是可用的根據 GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。
Furthermore, Qt Quick Controls potentially contains third party modules under the following permissive licenses:
| 有角材質的陰影值 | MIT 許可 |