Qt 5.12 - Qt Quick variables (attributes)

1 Introduction

Qt Quick standard library module is used to write QML application. Qt QML module provides language QML engine and infrastructure, and Qt Quick module provides all the basic types using QML create the required user interface. It provides a visual canvas, and comprising means for creating and animated visual component, receiving a user input, and creating the data model and the view type of the object instance delay. It includes a visual type, interaction type, animation models and views, and particle effects shader effects.
Qt Quick module provides both QML API (for providing a user interface to create QML language QML types), but also provides a C ++ API (using C ++ code extension QML applications).
A set of UI controls based on Qt Quick also be used to create the user interface.
Quick variable variable contains the basic variables QML, Quick Controls introduced, C ++ registered incoming variable.

2 QML basic variables

Here Insert Picture Description

3 QML basic types of module

Here Insert Picture Description

4 Quick variable controls introduced

4.1 QtQuick import basic types

Here Insert Picture Description

4.2 QtQuick object type

Most object types QtQuick import offers are based on the type of Item, and Item type itself is derived from QtObject.
Object Types

5 C ++ registered incoming variable

5.1 enum

typedef enum plus before, QML is not currently supported

6 changes

5.10 allows custom enumeration value, quick corresponding version 2.10 in QML

Attribute value change signal 7

format

on<Property>Changed
import QtQuick 2.0

TextInput {
    text: "Change this!"
    onTextChanged: {//text属性信号处理
        console.log("Text has changed to:", text)
    }
    MouseArea{
        anchors.fill:parent
        onClicked: {
           textChanged()//调用text属性信号         
        }
   }
}

reference

. 1, the Qt 5.12 Quick study notes -QT (Controls)
2, QT development (sixty-nine) - QML and C ++ mixed programming
. 3, QML C ++ objects
. 4, the Qt: 5.10 new features defined in QML enumeration
5, QML change signal value
6, an attribute value change signal
. 7, QML attribute change signal
8, summary of the response signal and a signal QML method

Published 496 original articles · won praise 601 · Views 1.55 million +

Guess you like

Origin blog.csdn.net/qq_38880380/article/details/103845009