QML is mainly used in mobile applications, focusing on touch input, smooth animation (60 frames per second) and user experience. The QML document describes the object tree of elements.
The QML module attached to Qt includes the original graphic building blocks (for example, rectangles, images) and modeling components; Behavioral components (for example, TapHandler, DragHandler, state, transition, animation) and more complex component controls (for example, buttons, sliders, drawers, menus).
These elements can be combined to build complex components, from simple buttons and sliders to complete Internet-enabled programs.
QML elements can be inline and through standard JavaScript. Js file. By using the C++ component of Qt framework, you can also integrate and extend elements seamlessly.
QML is a language; Its JavaScript runtime is a custom V4 engine, starting with Qt 5.2; Qt Quick is a 2D scene graph and a UI framework based on it. These are all part of the Qt declarative module, and this technology is no longer called Qt declarative.
QML and JavaScript codes can be compiled into local C++ binary files by using Qt Quick Compiler. Alternatively, there is a QML cache file format that dynamically stores the compiled version of QML so that it can be started faster in the next run.
Development tools
Because QML is very similar to JavaScript, it can be used by almost all code editors that support JavaScript.
However, starting from version 2. 1, the free cross-platform IDEQt Creator and many other ides provide comprehensive support for syntax highlighting, code completion, integration help and WYSIWYG editors.
Qml executable files can be used as scripts to run QML files. If the QML file starts with shebang, it can be executed directly. In order to deploy packaged applications, especially on mobile platforms, it is usually necessary to write a simple C++ startup program and package the necessary QML files into resources.