By default, QML recognizes the following Qt data types, which are automatically converted to a corresponding QML basic type when passed from C++ to QML and vice-versa:
Qt Type | QML Basic Type |
bool | |
unsigned int, int | |
double | |
float, qreal | |
Enums declared with Q_ENUM() or Q_ENUMS() |
左边是Qt c++类型 对应右边Qt qml类型