QML Applications#
Essential documentation for QML application developers
QML is a declarative language that allows user interfaces to be described in terms of their visual components and how they interact and relate with one another. It is a highly readable language that was designed to enable components to be interconnected in a dynamic manner, and it allows components to be easily reused and customized within a user interface. Using the QtQuick
module, designers and developers can easily build fluid animated user interfaces in QML, and have the option of connecting these user interfaces to any back-end C++ libraries.
What is QML?#
QML is a user interface specification and programming language. It allows developers and designers alike to create highly performant, fluidly animated and visually appealing applications. QML offers a highly readable, declarative, JSON-like syntax with support for imperative JavaScript expressions combined with dynamic property bindings.
import QtQuick import QtQuick.Controls ApplicationWindow { width: 400 height: 400 visible: true Button { id: button text: "A Special Button" background: Rectangle { implicitWidth: 100 implicitHeight: 40 color: button.down ? "#d6d6d6" : "#f6f6f6" border.color: "#26282a" border.width: 1 radius: 4 } } }
The QML language and engine infrastructure is provided by the Qt QML module. For in-depth information about the QML language, please see the Qt QML module documentation.
The following pages contain more information about QML:
First Steps with QML - begin using QML with these examples
The QML Reference - reference about the QML constructs and features
All QML APIs by Module
What is Qt Quick?#
Qt Quick is the standard library of QML types and functionality for QML. It includes visual types, interactive types, animations, models and views, particle effects and shader effects. A QML application developer can get access to all of that functionality with a single import statement.
The QtQuick
QML library is provided by the Qt Quick module. For in-depth information about the various QML types and other functionality provided by Qt Quick, please see the Qt Quick module documentation. Qt Quick adds visual types, animation types, and other QML types in addition to the standard QML types from Qt QML.
Qt Quick Projects#
Qt Creator sets up project environments for the following types of Qt Quick applications:
Scroll - scroll-based navigation
Stack - stack-based navigation
Swipe - page-based application with swipe navigation
Python - Qt for Python projects can have QML UIs and have Qt Creator support
For more information about Qt Quick applications, visit the following pages:
Design Tools - tools for designing UIs
Code Samples and Demos#
To learn more about uses of QML code, there are several code samples which show how QML types are used. In addition, there are several demos which show how QML code is used in applications.
Getting Started Programming with Qt Quick - a tutorial showing the creation of a simple QML text editor.
Advanced Application Development Topics#
Overview - QML and C++ Integration
Deploying QML Applications
Internationalization and Localization
Testing and Debugging
Qt Quick Test: QML Unit Testing Framework