Talk about QML

Source: Internet
Author: User

Ramble on QML/QT Quick

QML is introduced from QT 4.7, QML is a declarative language that makes it possible to encode as the designer thinks, and the QT Quick Element is the compilation unit of the application, and each frame of the storyboard is declared as a branch of the element tree, and each visual aspect of the branching element's attributes is declared as a frame, Transitions between frames can be decorated with various animations and effects.

The Qt quick runtime implements the UI and provides direct access to the local API and, where appropriate, can use C + + extensions for better performance. QT Quick is also implemented within QT, so it is easy to cross-platform.

QT is built for the modern way of product development. The logical part of the core is coded and optimized by the developer, and the user interface is done by the designer through visual tools. QT also integrates tools to support iterative development in this way.

QT Quick is built on a powerful QT. QML can be used to extend existing applications or to build new applications. QML is a complete extension from C + +.

QML documents generate plain text files on hard disks or on network resources, but can also be constructed from text data.

Let's take a look at the format of a simple QML file:


take a look at the effect:


In fact, QML is only a language, it is mainly the definition of the QML file syntax, as well as the basic implementation of QML language. and QT Quick built in a lot of common elements, so that we can be very convenient to use. I personally associate QML and QT quick relationships with programming languages and programming frameworks (or libraries).

Qt Quick includes a number of common visual elements, such as:


Qt Quick also provides support for animations, as well as model/view programming, and data storage.

Let's look at the documentation provided by QT for QML and QT quick introduction.

the first is QML:

The Qt QML module provides a framework and library for developing applications using the QML language. It defines and implements the language and engine, and provides APIs that enable application developers to extend the QML language using custom types and integrate QML code with javascript,c++.

The Qt QML module provides the QTQML QML module, which provides a series of core QML types for creating QML applications, and a QTQML C + + module that provides a series of C + + APIs for extending QML applications using custom types, and C + + Implement integration into QML applications.

The QML type provided by the QML module:


the C + + API provided by the QML module:


Note: The Qt QML module provides only the basic implementation of the language and QML, and does not provide a visual canvas or rendering engine for creating the user interface. These two parts are provided by Qt Quick with QT Quick provides many components, model/view support, animation framework and many QML details for creating the user interface.

Let's take a look at QT Quick:

Qt Quick is the standard library for creating QML applications. The QT qml module provides the QML engine as well as the Language Foundation, and the QT Quick module provides QML common elements for creating a basic user interface. It provides a visual canvas for creating and drawing visual components, accepting user input, creating data models, views, and proxies.

The Qt Quick module provides a Qtquick QML module that provides a series of QML types for creating a user interface, and a Qtquick C + + module that provides a series of C + + APIs for integrating user interfaces and Qtquick QML modules

The basic QML type provided by Qt Quick:


Qt Quick provides the C + + API:



Talk about QML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.