QML 范例和演示

Qt includes a set of examples and demos that show how to use various aspects of QML. The examples are small demonstrations of particular QML components, while the demos contain more complete and functional applications.

To run the examples and demos, open them in Qt Creator or use the included QML 查看器 工具。 QML 查看器 可以从命令行运行:

qmlviewer $QTDIR/demos/declarative/samegame/samegame.qml
					

On Mac OS X, you can run the included "QMLViewer" application from the Finder, or use the command line:

QMLViewer.app/Contents/MacOS/QMLViewer $QTDIR/demos/declarative/samegame/samegame.qml
					
					

演示

The QML demos integrate a variety of features to demonstrate how QML can be used to produce sophisticated interfaces and applications:

计算器 Flickr 移动版 扫雷
照片查看器 RSS 新闻阅读器 相同游戏
Twitter Web 浏览器

可以找到演示在 Qt 的 demos/declarative 目录。

范例

The QML examples are small, simple applications that show how to use a particular QML component or feature. If you are new to QML, you may also find the Hello World and 相同游戏 tutorials useful.

可以找到范例在 Qt 的 examples/declarative 目录。

动画

图像元素

文本元素

定位器

键交互

触控交互

UI 组件

玩具

模型和视图

XML

国际化 (i18n)

从右到左的用户界面

线程

屏幕取向

SQL 本地存储

C++ 扩展

Labs