嵌入式学习小组
直播中

李琴

7年用户 207经验值
私信 关注

求UI和输入输出的属性和方法?

UI和输入输出的属性和方法

回帖(1)

徐丹

2020-11-12 11:46:12

  • activeFocus : bool 只读属性,通过activeFocus可以获取focus是否在当前的element上,如果在,那么可以处理键盘鼠标的输入信息
  • anchors.alignWhenCentered : bool 指定不使用半个像素绘制图形,当需要居中一个elements,宽度或者高度是基数,不使用半个像素绘制
  • anchors.baseline : AnchorLine 如果是text控件,baseline是一个假想的,text 应该显示的位置。如果是非text控件则与top一致
  • anchors.baselineOffset : real baseline的偏移量。        anchors.baseline: parent.bottom;anchors.baselineOffset: -50, 在parent.bottom 之上50个像素显示
  • anchors.bottom : AnchorLine 元素底线
  • anchors.bottomMargin : real 元素底线与其他元素空隙
  • anchors.centerIn : Item 居中布局
  • anchors.fill : Item 填充anchors的区域到指定位置
  • anchors.horizontalCenter : AnchorLine 水平居中线
  • anchors.horizontalCenterOffset : real 指定水平居中线偏移量
  • anchors.left : AnchorLine 元素左边线
  • anchors.leftMargin : real 元素左边线与其他元素间隙
  • anchors.margins : real 指定上下左右4边与其他元素间隙
  • anchors.right : AnchorLine 元素左边线
  • anchors.rightMargin : real 元素左边线与其他元素间隙
  • anchors.top : AnchorLine 元素顶端线
  • anchors.topMargin : real 元素顶端线与其他元素间隙
  • anchors.verticalCenter : AnchorLine 垂直中间线
  • anchors.verticalCenterOffset : real 垂直中间线偏移量
  • antialiasing : bool 是否使用 antialiasing,如果使用速度会变慢,但是会有一些特效
  • baselineOffset : int 元素baseline的偏移量
  • children : list 元素包含的可视元素子对象
  • //下面4个参数,指定一组子对象的位置和大小

  • childrenRect.height :
  • childrenRect.width :
  • childrenRect.x : real
  • childrenRect.y : real
  • clip : bool 绘制元素时,是否裁剪
  • data : list 保存元素的子对象,如果是可视对象将自动添加此对象到children,如果是非可视对象,添加到resource
  • enabled : bool 制定元素是否接受输入事件,如鼠标,键盘
  • focus : bool 制定对象是否获取光标输入 (可写参数)
  • height : real 高
  • //如果没有制定元素宽高属性,那么使用下面2个属性,一般默认值为0

  • implicitHeight : real
  • implicitWidth : real
  • //layer部分与3D 相关

  • layer.effect : Component 3d 相关的代码
  • layer.enabled : bool 设置元素支持layer,有时可以优化qml的速度
  • layer.format : enumeration 设置opengl texture 格式,有些情形可以节约 texture的内存
  • layer.mipmap : bool 是否支持mipmap
  • layer.samplerName : string 与effect 中的texture匹配
  • layer.smooth : bool 知否支持smooth
  • layer.sourceRect : enumeration 渲染区域,可以大于当前的元素
  • layer.textureSize : size texture 大小
  • layer.wrapMode : enumeration 设置wrapmode (opengl)
  • opacity : real 透明度,取值在0.0-1.0(0完全透明)
  • parent : Item 当前元素父对象
  • resources : list 保存子对象中非可视元素
  • rotation : real 旋转角度
  • scale : real 缩放尺寸
  • smooth : bool 平滑处理
  • state : string 状态,通常有对象有关
  • states : list 元素的状态集合,也就是元素可以进入的状态集合。与动画有关
  • transform : list transform 是元素Transform的集合,与state转变,动画相关
  • transformOrigin : enumeration 当发送transform时(如旋转,移动等), 制定变化的开始位置。如旋转环绕的点
  • transitions : list 与动画和state有关,当state 变化时,调用transitions定义的一下内容
  • visible : bool 元素是否可见
  • visibleChildren : real 只读,子对象当前是否可见
  • width : real 宽度
  • x : real x
  • y : real y
  • z : real z