Table1
Item {
id: control
TableView {
id: table1
delegate: Rectangle {
color: control.selected === row ? "pink" : "white"
border.color: control.selected === row?"lightblue":"transparent"
border.width: 2
Text {
text: display
color: "black"
}
}
}
}
Table2
TableView{
id :tableView
headerDelegate:Rectangle{
color : "transparent"
Text
{
text: styleData.value
}
}
rowDelegate: Rectangle {
color : styleData.selected ? "pink" : "white"
border.color: styleData.selected ?"lightblue":"transparent"
}
itemDelegate: Rectangle{
color : "transparent"
Text {
color : "black"
text: styleData.value
}
}
style: TableViewStyle{
backgroundColor : "transparent"
}
}
}
effect
It is easy to make with rowDelegate at QtQuick Controls version 1.0 . I have no idea for setting border-color for row item while row selected. It seems border-color can only be set for each item in a row.
I made it with other four rectangles finally :)
like this: