Qt Quick Controls 2

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.2
					

The C++ 類 可以包括在應用程序中,使用以下 include 語句:

#include <QtQuickControls2>
					

要鏈接到相應 C++ 庫,將以下添加到 qmake 工程文件:

QT += quickcontrols2
					

更多細節,見 Getting Started with Qt Quick Controls 2 .

版本

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. 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
... ... ... ...

許可和歸屬

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 許可

話題

參考

範例