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;
posted @ 2018-04-09 15:03  时光旅者  阅读(2761)  评论(0编辑  收藏  举报