QML

QML
ParadigmMulti-paradigm: declarative, reactive, scripting
DeveloperQt Project
First appeared2009; 15 years ago (2009)
Stable release
6.4[1] / September 29, 2022; 2 years ago (2022-09-29)
Typing disciplinedynamic, strong
Websitedoc.qt.io/qt-5/qmlapplications.html
Influenced by
XAML,[2] JSON, JavaScript, Qt
Influenced
Qt, Ring[3]
QML
Filename extension
.qml
Internet media typetext/x-qml
Developed byQt Project
Type of formatScripting language
Websiteqt-project.org/doc/qt-5/qmlapplications.html

QML (Qt Modeling Language[4]) is a user interface markup language. It is a declarative language (similar to CSS and JSON) for designing user interface–centric applications. Inline JavaScript code handles imperative aspects. It is associated with Qt Quick, the UI creation kit originally developed by Nokia within the Qt framework. Qt Quick is used for mobile applications where touch input, fluid animations and user experience are crucial. QML is also used with Qt3D[5] to describe a 3D scene and a "frame graph" rendering methodology. A QML document describes a hierarchical object tree. QML modules[6] shipped with Qt include primitive graphical building blocks (e.g., Rectangle, Image), modeling components (e.g., FolderListModel, XmlListModel), behavioral components (e.g., TapHandler, DragHandler, State, Transition, Animation), and more complex controls (e.g., Button, Slider, Drawer, Menu). These elements can be combined to build components ranging in complexity from simple buttons and sliders, to complete internet-enabled programs.

QML elements can be augmented by standard JavaScript both inline and via included .js files. Elements can also be seamlessly integrated and extended by C++ components using the Qt framework.

QML is the language; its JavaScript runtime is the custom V4 engine,[7] since Qt 5.2;[8] and Qt Quick is the 2D scene graph and the UI framework based on it. These are all part of the Qt Declarative module, while the technology is no longer called Qt Declarative.

QML and JavaScript code can be compiled into native C++ binaries with the Qt Quick Compiler.[9] Alternatively there is a QML cache file format[10] which stores a compiled version of QML dynamically for faster startup the next time it is run.

  1. ^ "Qt 6.4 Released".
  2. ^ "Which interface for a modern application?". scriptol.
  3. ^ Ring Team (5 December 2017). "The Ring programming language and other languages". ring-lang.net. ring-lang.
  4. ^ "Qt Declarative API Changes | Qt Blog". March 25, 2014. Archived from the original on March 25, 2014.
  5. ^ "Qt 3D Overview | Qt 3D 5.13.1". doc.qt.io.
  6. ^ "All QML Types | Qt 5.13". doc.qt.io. Retrieved September 7, 2019.
  7. ^ Knoll, Lars (2013-04-15). "Evolution of the QML engine, part 1". Retrieved 2018-05-11.
  8. ^ "What's New in Qt 5.2". Retrieved 2018-05-11.
  9. ^ "Qt Quick Compiler". Retrieved September 7, 2019.
  10. ^ "Deploying QML Applications | Qt 5.13". doc.qt.io. Retrieved September 7, 2019.