qml tableview红白间隔显示且行高可设置,并且cell 文字居中显示
来源:互联网 发布:mac可以用excel吗 编辑:程序博客网 时间:2024/05/23 15:06
工作人员,为什么效果图上传不了???
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Item{
width: 800; height: 600
ListModel{
id:libraryModel
ListElement{title: "aaa"; author: "AAA"}
ListElement{title: "bbb"; author: "BBB"}
ListElement{title: "ccc"; author: "ccc"}
}
TableView{
anchors.fill: parent
model:libraryModel
TableViewColumn{role:"title"; title: "Title"; width: 100}
TableViewColumn{role:"author"; title: "Author"; width: 200}
rowDelegate: Rectangle{
height: 50
color: styleData.selected?"blue":(styleData.alternate?"red":"white")
}
itemDelegate: Rectangle {
height: 50
color: "transparent"
// border.color: "black"
// border.width: 1
Text {
anchors.centerIn: parent
// anchors.horizontalCenter: parent.horizontalCenter
color: styleData.textColor
// elide: styleData.elideMode
text: styleData.value
}
}
}
}
阅读全文
0 0
- qml tableview红白间隔显示且行高可设置,并且cell 文字居中显示
- tableview——设置cell的文字居中和透明度
- Delphi DBGridEh 嵌入图片,显示文字,且上下左右居中
- 在Xib中的tableView里设置cell没有显示出来
- iOS 开发中tabBarItem不显示文字,只显示图片,且图片居中显示
- 文字居中显示
- RaidoButton文字居中显示
- echarts饼图label字体颜色设置并且居中显示
- iOS 在TableView的Cell之间设置空白间隔空间
- iOS 设置cell的在tableView中的间隔距离
- 设置文字居中显示的三句代码
- 设置UITextView的时候文字居中显示了?
- 设置按钮上的文字靠左靠右居中显示
- 不设置行高,文字水平垂直居中显示
- UIButton 设置图片和文字上下居中显示
- UIMenuItem在tableview中对应cell显示
- TableView不显示没内容的Cell
- IOS中TableView的cell显示问题
- Easyui 搭建后台管理界面
- Redis 安装 启动 连接 配置 重启
- Android 快速发布开源项目到jcenter,出坑日记
- java编程原则
- 5 YAML 简介
- qml tableview红白间隔显示且行高可设置,并且cell 文字居中显示
- 哪些软素质互联网职场必备
- 已存在库表创建models(django)/其中报错原因
- [未完待续]PHP函数
- hadoop2.7.4源码编译/eclipse源码编译及踩坑记录
- Shell 基础
- 文本对齐
- 详解Java 流(Stream)、文件(File)和IO(一)
- 引人深思的微小说