QML learning experience and qml Learning

Source: Internet
Author: User

QML learning experience and qml Learning

Qt Quick is used in QML. Just as Qt is used in C ++, QML is a new language developed in Qt, and Qt Quick is a component library of this language, it contains many ready-to-use components written with QML.

QML Hello World

// Import QtQuick 2.4 import QtQuick. window 2.2 // part of the object declaration Window {visible: true MainForm {anchors. fill: parent mouseArea. onClicked: {Qt. quit ();}}}

As shown in this code, a QML document defines a QML Object Tree consisting of two parts: an import part and an object declaration part.

The import Statement is similar to # include in C ++. Only related modules can be imported to use the types and functions. The QtQuick module is imported here. This is the component set we selected when creating the project. It contains the basic types and functions required to create the user interface. the Window module provides the Window type, which can create a top-level Window for the Qt Quick scenario.

Visible in Window is the properties of Window, used to set whether the Window is displayed. You can view all the properties and usage of a type in the help document.

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.