我对TableViewColumn
的自定义委托有几个问题。这是我的TreeView:
TreeView {
id: view
anchors.fill: parent
sortIndicatorVisible: true
model: fileSystemModel
rootIndex: rootPathIndex
selection: sel
selectionMode: 2
TableViewColumn {
id: namecolumn
title: "Name"
role: "fileName"
resizable: true
width: parent.width-sizeWidth-dateWidth-scrollBarWidth
delegate: ItemDelegate {
id: fileCheckDelegate
Row{
CheckBox{
id: cbox
visible: (model.isDir==true) ? false : true
}
Text{
id: itext
text: model.fileName
width: namecolumn.width-itext.x-cbox.width
elide: Text.ElideRight
}
}
ToolTip {
parent: fileCheckDelegate
visible: hovered
delay: 1000
text: qsTr(model.fileName)
}
}
}
TableViewColumn {
id: sizecolumn
title: "Size"
role: "size"
resizable: false
width: sizeWidth
}
TableViewColumn {
id: datecolumn
title: "Date Modified"
role: "lastModified"
width: dateWidth
resizable: false
}
}
问题见下图:
感谢您的帮助,