qml TableView样式表

QQ:609162385
在这里插入图片描述

Rectangle{
                        x: 8
                        y: 224
                        width: 286
                        height: 424
                        color: "#ffffff";
                        QC14.TableView {
                            anchors.fill: parent
                            id: tableView
                            anchors.topMargin: 0
                            TableViewColumn {title: "name"; role: "0"; width: 150}
                            TableViewColumn {title: "data"; role: "1"; width: 150}

                            model:inspectModel
                            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
                                        }
                                    }

                            ColorAnimation {
                                from: "white"
                                to: "black"
                                duration: 200
                            }
                            alternatingRowColors: false
                            backgroundVisible: false
                        }
                    }

猜你喜欢

转载自blog.csdn.net/cqltbe131421/article/details/86502840
QML
今日推荐