QML之Item

导入声明: import    QtQuick 2.2
继承:QtObject
属性:
activeFocus : bool   只读,只读属性就不要尝试赋值了,否则会出错的,表明当前元素是否有活动焦点,与键盘事件有关,通过 focus 获取属性值。
activeFocusOnTab : bool    默认 false ,与 Tab 键有关,设置当前元素是否在Tab 键焦点范围内。
anchors     组属性,用于布局
anchors.top : AnchorLine
anchors.bottom : AnchorLine
anchors.left : AnchorLine
anchors.right : AnchorLine
anchors.horizontalCenter : AnchorLine
anchors.verticalCenter : AnchorLine
anchors.baseline : AnchorLine
anchors.fill : Item
anchors.centerIn : Item
anchors.margins : real
anchors.topMargin : real
anchors.bottomMargin : real
anchors.leftMargin : real
anchors.rightMargin : real
anchors.horizontalCenterOffset : real
anchors.verticalCenterOffset : real
anchors.baselineOffset : real
anchors.alignWhenCentered : bool
antialiasing : bool    默认 false ,设置抗锯齿效果
baselineOffset : int   在当前坐标系下设置基准位置。
children : list<Item>    参照 data 属性
childrenRect    组属性,有 x  y  width  height 四个属性,都是 real 类型,只读,叠加了子元素的位置和大小。
childrenRect.x : real
childrenRect.y : real
childrenRect.width : real
childrenRect.height : real
clip : bool    默认 false ,设置为 true 时将剪切子元素
data : list<Object>  默认属性,默认属性也就没必要显式地把关键字写出来,是可以省略的,作为一个对象列表,自动把可视化元素加到了 children 元素列表中,把其它的对象则加到了 resources 对象列表中。
enabled : bool     默认 true ,设置为 false 时将不再响应鼠标和键盘事件,对子元素也有影响。
focus : bool       默认 false ,设置元素是否有焦点区以接收键盘事件。
height : real     高度
implicitHeight : real   大多数元素默认为 0x0 ,比如说Rectangle ,用来设置元素的自然大小,但有些元素是不一样的,比如说 Text 的这对属性是只读的。
implicitWidth : real

layer.effect : Component   layer设置图层效果,常与 OpenGL 结合。
layer.enabled : bool
layer.format : enumeration
layer.mipmap : bool
layer.samplerName : string
layer.smooth : bool
layer.sourceRect : rect
layer.textureSize : size
layer.wrapMode : enumeration
opacity : real    默认为 1 ,可以在 0.0  1.0 之间设置元素的透明度,会影响子元素的显示效果,但不改变子元素的 opacity 值,为 0 时完全透明但不影响事件处理。
parent : Item     可用来设置当前元素的父对象
resources : list<Object>  参照 data 属性。
rotation : real    默认为 0 ,设置元素旋转角度,值为正时顺时针旋转,为负时逆时针旋转。
scale : real     默认为 1 ,设置元素显示比例,值为负时有镜像效果。
smooth : bool   默认 true ,主要用于图像。
state : string    默认为空字符串,如果设置了 state 也可以用空字符串来赋值以恢复默认状态。
states : list<State>   状态列表。
transform : list<Transform>    Transform 列表, Transform 包括了 Rotation Scale  Translate 
transformOrigin : enumeration  枚举类型,默认为 Item.Center ,设置 scale  rotation 变换原点,枚举值包括
transitions : list<Transition>   Transition 列表,常用来设置一些动画。
visible : bool   默认 true ,设置为 false 时元素不可见,不能响应鼠标事件,但可以处理键盘事件。
visibleChildren : list<Item>   只读,会受到 visible 的影响。
width : real   宽
x : real    设置元素的位置,坐标是相对 parent 
y : real
z : real    默认为  0  ,设置兄弟元素间的堆叠顺序,数值大的会覆盖数值小的,可以是负值。


1.activeFocus 控制能否在光标出输入,为true时能够输入。

当为false时。不能输入,当鼠标点红框找不到到闪烁光标,且也不能输入。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值