qml: 支持的基本类型

qml支持的基本类型有:

  1. bool
  2. unsigned int, int;
  3. float    double   qreal
  4. QString
  5. QUrl
  6. QColor
  7. QData,  QTime  QDataTime
  8. QPoint    QPointF
  9. QSize      QSizeF
  10. QRect      QRectF
  11. QVariant

    通过QVariant, QString,  借助于jSon,我们可以实现C++与qml之间的复杂数据结构传递;

  •     在C++中,通过Json打包数据成QVariant;
  •     qml通过槽函数获取QVariant;
  •     qml通过js解析QVariant;
原文地址:https://www.cnblogs.com/yinwei-space/p/8759911.html