Chinaunix首页 | 论坛 | 博客
  • 博客访问: 261381
  • 博文数量: 37
  • 博客积分: 1126
  • 博客等级: 少尉
  • 技术积分: 930
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-29 17:22
文章分类

全部博文(37)

文章存档

2014年(1)

2013年(11)

2012年(19)

2009年(6)

我的朋友

分类: C/C++

2012-06-27 21:52:56

今天在QML里面写了这么一句
property QTime secords然后出错QTime is not a type 烦恼啊烦恼,文档里面不是说支持的么===========================================================================Supported data types

Any C++ data that is used from QML - whether as custom properties, or parameters for signals or functions - must be of a type that is recognizable by QML.

By default, QML recognizes the following data types:

  • bool
  • unsigned int, int
  • float, double, qreal
  • , , 
  • *
  • Enumerations declared with ()

To allow a custom C++ type to be created or used in QML, the C++ class must be registered as a QML type using(), as shown in the  section above.

=====================================================================================================真烦人,Nokia是骗纸,最后又看见文档一个关于QML的property所支持的类型===================================================================================================== Supported property types

All QML properties are typed. The examples above show properties with int and string types; notice that the type of the property must be declared. The type is used to determine the property behavior, and how the property is defined in C++.

A number of property types are supported by default. These are listed in the table below, with their default values and the corresponding C++ type:

QML Type NameDefault valueC++ Type Name

0

int

false

bool

0.0

double

0.0

double

"" (empty string)

"" (empty url)

#000000 (black)

undefined

undefined

===============================================================原来大多数类型在QML中都有替代品,少数没有的写入QML仍然提示XXXX is not a type不过基本常用的类型都有了,可以满足日常需要了,剩下日后再研究

阅读(10752) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

qyvlik2015-01-02 21:19:23

// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

QtObject{

// private:

    property QtObject __object: QtObject{

    }
    property Timer __timer: Timer{

    }
}