导入声明:
import
QtQuick 2.2
继承:QtObject
属性:
activeFocus : bool 只读,只读属性就不要尝试赋值了,否则会出错的,表明当前元素是否有活动焦点,与键盘事件有关,通过 focus 获取属性值。activeFocusOnTab : bool 默认 false ,与 Tab 键有关,设置当前元素是否在Tab 键焦点范围内。anchors 组属性,用于布局
anchors.top : AnchorLineanchors.bottom : AnchorLineanchors.left : AnchorLineanchors.right : AnchorLineanchors.horizontalCenter : AnchorLineanchors.verticalCenter : AnchorLineanchors.baseline : AnchorLineanchors.fill : Itemanchors.centerIn : Itemanchors.margins : realanchors.topMargin : realanchors.bottomMargin : realanchors.leftMargin : realanchors.rightMargin : realanchors.horizontalCenterOffset : realanchors.verticalCenterOffset : realanchors.baselineOffset : realanchors.alignWhenCentered : bool
antialiasing : bool 默认 false ,设置抗锯齿效果baselineOffset : int 在当前坐标系下设置基准位置。children : list<Item> 参照 data 属性childrenRect 组属性,有 x 、 y 、 width 、 height 四个属性,都是 real 类型,只读,叠加了子元素的位置和大小。
childrenRect.x : realchildrenRect.y : realchildrenRect.width : realchildrenRect.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 : boollayer.format : enumerationlayer.mipmap : boollayer.samplerName : stringlayer.smooth : boollayer.sourceRect : rectlayer.textureSize : sizelayer.wrapMode : enumerationopacity : 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 和 TranslatetransformOrigin : enumeration 枚举类型,默认为 Item.Center ,设置 scale 、 rotation 变换原点,枚举值包括transitions : list<Transition> Transition 列表,常用来设置一些动画。visible : bool 默认 true ,设置为 false 时元素不可见,不能响应鼠标事件,但可以处理键盘事件。visibleChildren : list<Item> 只读,会受到 visible 的影响。width : real 宽x : real 设置元素的位置,坐标是相对 parent 的y : realz : real 默认为 0 ,设置兄弟元素间的堆叠顺序,数值大的会覆盖数值小的,可以是负值。
1.activeFocus 控制能否在光标出输入,为true时能够输入。
当为false时。不能输入,当鼠标点红框找不到到闪烁光标,且也不能输入。![]()
![]()