QML 教程

本教程将介绍 QML——Qt Quick 用户界面的编程语言。本教程并非面面俱到,而是侧重于讲解核心原理,并根据需要介绍相关特性。

通过本教程的各个步骤,我们将了解 QML 值类型,创建带有属性和信号的自定义 QML 组件,并借助状态和过渡效果制作一个简单的动画。

第一章从一个最简单的“Hello world”程序开始,后续章节将介绍新的概念。

本教程的源代码位于examples/quick/tutorials/helloworld 目录中。

教程章节:

  1. 值类型
  2. QML 组件
  3. 状态与转换

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.