QML类型说明-FontLoader
来源:互联网 发布:synthesia mac 编辑:程序博客网 时间:2024/06/06 13:12
FontLoader
ImportStatement: import QtQuick 2.2
Properties
name :string
source : url
status :enumeration
DetailedDescription
通过名称或URL加载字体。
status是字体加载的状况,对加载远程字体是有用的。
例如:
importQtQuick 2.0
Column {
FontLoader { id: fixedFont; name:"Courier" }
FontLoader { id: webFont; source:"http://www.mysite.com/myfont.ttf" }
Text { text: "Fixed-size font";font.family: fixedFont.name }
Text { text: "Fancy font";font.family: webFont.name }
}
Property Documentation
name :string
加载的字体的名字,当使用url属性加载字体时,它自动设置。这个属性用于设置Text组件的font.family属性。
例如:
Item {
width: 200; height: 50
FontLoader {
id: webFont
source:"http://www.mysite.com/myfont.ttf"
}
Text {
text: "Fancy font"
font.family: webFont.name
}
}
source : url
加载字体的URL
status :enumeration
字体加载的情况,它是下面的值之一:
FontLoader.Null- 没有字体被设置
FontLoader.Ready- 字体加载完毕
FontLoader.Loading- 字体正在被加载
FontLoader.Error- 加载字体发生错误
用一些方式处理状态的变化,例如:
触发状态改变:
State {name: 'loaded'; when: loader.status == FontLoader.Ready }
实现onStatusChanged信号处理:
FontLoader {
id: loader
onStatusChanged: if (loader.status ==FontLoader.Ready) console.log('Loaded')
}
绑定状态值:
Text { text: loader.status == FontLoader.Ready ?'Loaded' : 'Not loaded' }- QML类型说明-FontLoader
- QML类型说明-Accessible
- QML类型说明-Action
- QML类型说明-Address
- QML类型说明-Affector
- QML类型说明-Age
- QML类型说明-Altimeter
- QML类型说明-AltimeterReading
- QML类型说明-AmbientLightReading
- QML类型说明-AmbientLightSensor
- QML类型说明-AnchorAnimation
- QML类型说明-AnchorChanges
- QML类型说明-AngleDirection
- QML类型说明-ParallelAnimation
- QML类型说明-Animator
- QML类型说明-AnimatedImage
- QML类型说明-AnimatedSprite
- QML类型说明-ApplicationWindow
- Python函数可变参数定义及其参数传递方式详解
- attribute和property的区别
- 九度_题目1283:第一个只出现一次的字符
- Android开发中,使用线程应该注意的问题
- 黑马程序员——java基础——集合框架(2)Map
- QML类型说明-FontLoader
- 大学学的网络、出来后感觉自己啥也没学会哇~怎么办、有什么好书推荐吗~
- centos搭建hls系统
- [leetcode] Text Justification
- 数据库查询优化
- 反编译APK文件
- Android中Intent传递对象的两种方法(Serializable,Parcelable)
- Hibernate中的inverse详解
- 【iOS XMPP】使用XMPPFramewok(一):添加XMPPFramework(XCode 4.6.2)