Qt Quick 范例和教程

Building UIs with QML Qt includes several examples to demonstrate a particular usage. The examples run as applications or as non-GUI examples in Qt Creator. Qt tutorials show the step-by-step information and give insight to particular code snippets.

此页面列表 Qt QML and Qt Quick examples, however, many other Qt modules contain examples related to their QML API.

运行范例和演示

The examples are packaged with the Qt installers and are accessed through Qt Creator. For more information about running examples in Qt Creator, visit the Building and Running an Example page.

Open and run examples within Qt Creator’s 欢迎 模式。大多数范例可在各平台上运行且可搜索特定平台范例,在搜索字段中键入平台名称 (或任何关键字)。例如,键入 mobile 在搜索字段中,列表的范例完全兼容 mobile 平台。

To view other examples and tutorials, visit the Qt Examples And Tutorials page.

Qt Quick 演示

这里是功能齐全的演示应用程序的列表。它们是完整的应用程序,展示如何构建和结构可部署的 Qt 应用程序。许多演示可部署到移动和桌面平台。

开发 Qt Quick 应用程序

以下页面展示如何开发 Qt 应用程序使用 Qt Creator and Qt Quick. The pages demonstrate various steps such as use cases and introductory material. For more information about Qt Quick Applications and related modules, visit the QML Applications page.

开发环境

  • 创建 Qt Quick 工程

  • 创建组件

  • 从图形软件导出设计

  • 使用带插件的 QML 模块

从 QML 和 Qt Quick 开始

  • 采用 QML 的第一步

  • Qt Quick 文本编辑器

  • SameGame

使用案例

  • QML 视觉类型

  • QML 响应用户输入

  • QML 动画

  • 在 QML 显示文本

  • QML 布局

  • 样式和主题支持

  • QML 集成 JavaScript

扩展 QML

以下教程展示基于 QML 的应用程序如何与 C++ 代码组合,使用 Qt QML 模块。 扩展的 QML 有关信息,拜访 集成 QML 和 C++ 页面。

Extending-QML—Adding-Types-Example

导出 C++ 类。

Extending-QML—Extension-Objects-Example

Extension Objects.

Extending-QML—Object-and-List-Property-Types-Example

导出 C++ 特性。

Extending-QML—Inheritance-and-Coercion-Example

C++ Inheritance and Coercion.

Extending-QML—Default-Property-Example

默认特性。

Extending-QML—Grouped-Properties-Example

分组特性。

Extending-QML—Attached-Properties-Example

附加特性。

Extending-QML—Signal-Support-Example

信号支持。

Extending-QML—Methods-Example

方法支持。

Extending-QML—Property-Value-Source-Example

特性值源。

Extending-QML—Binding-Example

绑定。

范例

范例是展示如何实现各种 Qt Quick 特征的小型应用程序。范例可运行于各平台,且可从 Qt Creator 中打开。

QML 类型和控件

布局和视图

图像和图形

键盘、聚焦和触摸

系统和事件

场景图形