Qml 在TableView中指定行
如果行的timeToReply>15,如何将行的背景色更改为红色。我没时间进去。我怎么能做到Qml 在TableView中指定行,qml,qt5,Qml,Qt5,如果行的timeToReply>15,如何将行的背景色更改为红色。我没时间进去。我怎么能做到 TableView { model: someModel TableViewColumn{title:"Time";role: "timeToReply";width: 170} rowDelegate: Item { clip: true Text { anchors.verticalCen
TableView
{
model: someModel
TableViewColumn{title:"Time";role: "timeToReply";width: 170}
rowDelegate: Item {
clip: true
Text {
anchors.verticalCenter: parent.verticalCenter
color: {
if(timeToReply>15) //problem
{
color="red"
}
else
{
color="black"
}
}
text: styleData.value
elide: Text.ElideMiddle
}
}
}
Qt中还没有QML树视图。还有,列=时间是多少?