Qt Quick Controls

Qt Quick Controls 2 provides a set of controls that can be used to build complete interfaces in Qt Quick. The module was introduced in Qt 5.7.

Qt Quick Controls 2 comes with a selection customizable styles. See Styling Qt Quick Controls 2 了解更多细节。

先决条件

The QML 类型 可以使用以下 import 语句导入应用程序,在 .qml 文件:

import QtQuick.Controls 2.12
					

The C++ 类 可以包括在应用程序中,使用以下 include 语句:

#include <QtQuickControls2>
					

要链接到相应 C++ 库,将以下添加到 qmake 工程文件:

QT += quickcontrols2
					

更多细节,见 Getting Started with Qt Quick Controls 2 .

从源代码构建

当从源代码构建时,确保 Qt Graphical Effects module is also built, as Qt Quick Controls 2 requires it.

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 2 modules by one, until Qt 5.12, where the import versions match Qt's minor version. The experimental Qt Labs modules use import version 1.0.

Qt QtQuick QtQuick.Controls ,
QtQuick.Controls.Material ,
QtQuick.Controls.Universal ,
QtQuick.Templates
Qt.labs.calendar ,
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
... ... ... ...

许可和归属

Qt Quick Controls 2 is available under commercial licenses from Qt 公司 。此外,它是可用的根据 GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

Furthermore Qt Quick Controls 2 potentially contains third party modules under following permissive licenses:

有角材质的阴影值 MIT 许可

话题

参考

范例