The Qt QML module provides the definition and implementation of various convenience types that can be used with the QML language. This includes elementary QML types, which can provide the basis for further extensions to the QML language. The QtObject and Component object types are non-visual and provide building-blocks for extensions to QML.
類型提供通過
QtQml
module are only available in a QML document if that document imports the
QtQml
namespace (or if the document imports the
QtQuick
namespace, as noted below).
要使用模塊,import
QtQml
模塊采用以下語句:
import QtQml
很多客戶端將從不需要使用
QtQml
module directly, but will rather import it indirectly via the
QtQuick
模塊如下:
import QtQuick
見 Qt Quick module documentation for more information about its types.
The QML types for creating lists and models, such as ListModel and ListElement , belong to a submodule, QtQml.Models .
The WorkerScript QML type belongs to the submodule QtQml.WorkerScript .
Both,
QtQml.Models
and
QtQml.WorkerScript
are automatically imported whenever you import
QtQml
. All their types are then available, too.
The
Qt Quick
模塊自動導入
QtQml
and, transitively,
QtQml.Models
and
QtQml.WorkerScript
, making all their types available whenever you import
QtQuick
.
下列 QML 值類型 有提供:
| 具有 X 和 Y 屬性的值 | |
| 具有 X、Y、寬度及高度屬性的值 | |
| 具有寬度和高度屬性的值 |
下列 QML 序列類型 are provided by the Qt QML module in addition to the ones registered with each value type and object type:
std::vector<QString>
std::vector<QUrl>
std::vector<bool>
std::vector<int>
std::vector<float>
std::vector<double>
下列 QML 對象類型 有提供:
| 使能夠創建任意特性綁定 | |
| 封裝 QML 組件定義 | |
| 描述信號的一般化連接 | |
| 提供日期函數 | |
| 提供特定區域設置的特性和格式化數據 | |
| 定義 QML 日誌類彆 | |
| 提供錶示數字值的對象 | |
| 提供帶有有用 Qt 枚舉和函數的全局對象 | |
| 基本 QML 類型 | |
| 按指定間隔觸發處理程序 | |
| 用於嚮服務器發送請求的對象 |