Qt QML
2018-01-04 12:00
176 查看
Qt QML
The Qt QML module provides a framework for developing applications and libraries with the QMLlanguage. It defines and implements the language and engine infrastructure, and provides an API to enable application developers to extend the QML language with custom types and integrate QML code with JavaScript and C++. The Qt QML module provides both
a QML API and a C++
API.
Qt QML模块为使用QML
语言开发应用程序和库提供了一个框架。它定义并实现了语法和基础引擎,还为程序员提供了API去使用自定义类型和用JavaScript和C++语言整合的QML代码扩展QML语言。Qt QML模块同时提供QML
API和C++
API。
Note that while the Qt QML module provides the language and infrastructure for QML applications, the Qt
Quick module provides many visual components, model-view support, an animation framework, and much more for building user interfaces.
注意:Qt QML模块为QML应用程序提供语法和基础结构的同时,Qt
Quick模块也为建立用户界面提供了很多可视化组件,视图模型支持,动画框架等。
For those new to QML and Qt Quick, please see QML Applications for
an introduction to writing QML applications.
要了解QML和Qt Quick的新功能,请查看QML
Applications(编写QML应用程的介绍)。
Getting Started
新手入门
To include the definitions of the module's classes, use the following directive:要引入模块中类的定义,直接使用以下代码:
#include <QtQml>
The QML types in Qt QML are available through the
QtQMLimport. To use the types, add the following import statement to your .qml file:
Qt QML中的QML类型也可以通过QtQML的import引入,要使用这种方法,在你的.qml文件中添加以下import语句
import QtQml 2.0
To link against the module, add this line to your qmake
.profile:
要链接模块,添加这行到你的qmake使用的.pro文件中。
QT += qml
QML and QML Types
QML和QML类型
The Qt QML module contains the QML framework and important QML types used in applications. The constructs of QML are described in the TheQML Reference.
In addition to the QML Basic Types, the module
comes with the following QML object types:
Component
QtObject
Binding
Connections
Timer
The Qt global object provides useful enums and functions for
various QML types.
Lists and Models
New in Qt 5.1, the model types are moved to a submodule, QtQml.Models. The Qt
QML Models page has more information.
DelegateModel
DelegateModelGroup
ListElement
ListModel
ObjectModel
JavaScript Environment for QML Applications
JavaScript expressions allow QML code to contain application logic. Qt QML provides the framework for running JavaScript expressions in QML and from C++.These sections are from The QML Reference.
Integrating QML and JavaScript
Using JavaScript Expressions with QML
Dynamic QML Object Creation from JavaScript
Defining JavaScript Resources In QML
Importing JavaScript Resources In QML
JavaScript Host Environment
Integrating QML with C++ Applications
The module also provides the framework for running QML applications. The QML framework allows QML code to contain JavaScript expressions and for the QML code to interact with C++ code.Important C++ Classes Provided By The Qt QML Module
Integrating QML and C++
Additional Frameworks
The Declarative State Machine Framework
Licenses and Attributions
Qt QML is available under commercial licenses from The Qt Company. In addition,it is available under the GNU Lesser General Public License,
version 3, or the GNU General Public License, version 2.
See Qt Licensing for further details.
Furthermore Qt QML potentially contains third party modules under following permissive licenses:
JavaScriptCore Macro Assembler | BSD 2-clause "Simplified" License |
Guides and Other Information
Further information for writing QML applications:The QML Reference
QML Applications - essential information for application
development with QML and Qt Quick
Qt Quick - a module which provides a set of QML types and
C++ classes for building user interfaces and applications with QML
Reference
C++ ClassesQML Types
Examples
相关文章推荐
- Windows下发布一个Qt程序隐藏QML文件
- QT之QML与C++混合编程
- Qt Quick QML Text
- qt qml和c++交互的一个简单例子
- Qt qml 滑块
- qt-qml移动开发之在ios上开发和部署app流程简介
- QML官方系列教程——Using Qt Quick Designer
- Qt:终于来了!基于QML和WebGL开发网页端
- Qt qml 单例模式
- 解决Qt和QML都会出现的问题,Qt5.6.1 msvc2013版本,qt.network.ssl: QSslSocket: cannot call unresolved function SSLv2
- Qt:QML:不同目录qml模块的调用
- Qt中使用Quick2动态加载QML组件的两种方式
- 关于用QT的QML开发Android程序的点滴记录
- Qt:使用C++还是QML
- Qt-Qml-隐藏标题栏-程序依附任务栏
- Qt 5.6.0 使用QML在某些情况下一构造WebView/WebEngineView就出错的一种解决办法
- 第四篇 QML代码与现有Qt UI代码整合
- Qt移动应用开发:实现跨平台的QML和OpenGL混合渲染
- Qt-QML-Popup,弹层界面编写
- qt之qml简单示例并加载到C++程序中,视图、场景、项、撤消、重做的实现