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.