您的位置:首页 > Web前端 > HTML

使用HTML语法图文混排

2016-06-07 17:45 295 查看
注:指定像素大小不可使用HTML的px语法

Flickable {
anchors.fill: parent
contentWidth: parent.width
contentHeight: col.height + 20

Column {
id: col
x: 10; y: 10
spacing: 20
width: parent.width - 20
property var hAlign: Text.AlignLeft

Loader{
property string txt:"<h2>指定大小</h2>:<img width='48' height='48' src='qtlogo.png' \><br>" +
"<h2>对齐middle</h2>:<img align='middle' width='48' height='48' src='qtlogo.png' \><br>"+
"<h2>对齐top</h2>:<img align='top' width='48' height='48' src='qtlogo.png' \><br>"+
"<h2>对齐bottom</h2>:<img align='bottom' width='48' height='48' src='qtlogo.png' \><br>"+
"<h2>指定大小</h2>:<img width='32' height='32' src='qtlogo.png' \>" +
"<img width='48' height='48' src='qtlogo.png' \>" +
"<img width='72' height='72' src='qtlogo.png' \>"

width: parent.width;
sourceComponent: component

}

}

Component{
id:component;
Text {
id:subtext;
text: parent.txt
width: parent.width
font.pointSize: 14
wrapMode: Text.WordWrap
textFormat: Text.StyledText
horizontalAlignment: root.hAlign
}

}
}




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: