2013-01-01 66 views
1

我开始学习QML。预期房产类型大小

我发现here在QML中有'size'类型。但是,当我试图使用它:

property size buttonSize: "75x30" 

我得到的错误:

Button.qml:13:14: Expected property type 
     property size buttonSize: "75x30" 
       ^

为什么?

回答

3

size不作为属性类型直接支持。

支持的类型列于here
您还可以使用variant来存储尺寸:

property variant buttonSize: Qt.size(75,30)