【发布时间】:2019-07-11 10:14:46
【问题描述】:
我有一个简单的TableView 和 4 个TableViewColumns,我通常不使用 qml,所以我不确定如何在这段代码中正常工作。
我想要的是我需要将鼠标悬停在 TableView 标题(列名)上。我检查了一遍,没有找到任何简单的解决我的问题的方法。
我尝试在TableVIewColumn 中使用工具提示,但它从未出现,而且我发现TableViewColumn 中不支持鼠标区域。也许解决方案很简单,但我不知道
瞬间。
Rectangle {
width: parent.width
height: parent.height
TableView {
id: table
width: parent.width
height: parent.height
headerVisible: true
TableViewColumn {
id: time
role: "t-stamp"
title: "Time"
width: 60
}
TableViewColumn {
id: d
role: "id"
title: "SignId"
width: 40
}
TableViewColumn {
id: sid
role: "s-id"
title: "StratId"
width: 50
}
TableViewColumn {
id: stratname
role: "strat_name"
title: "StratName"
width: 200
}
Connections{
target: MessageTabelModel
onUpdateView:{
table.resizeColumnsToContents()
}
}
model: MessageTabelModel
}
}
【问题讨论】:
标签: hover qml highlight mouseover