我想為 TreeView 中的列添加標題。有沒有辦法在 Qt6.3 中做到這一點?
目前,我的 qml 看起來像這樣:
TreeView {
id: tree_view
anchors{
fill: parent
margins: 10
}
model: FileSystemModel
clip: true
delegate: TreeViewDelegate {
contentItem: Text {
anchors.leftMargin: leftMargin
anchors.rightMargin: rightMargin
text: {
if (column === 0)
file_name
else if (column === 1)
inner_files
else
file_size
}
}
}
}
我不能使用 TableViewColumn 因為編譯器說“它不是一種型別”。由于 TreeView 組件存在同樣的問題,我已經從 6.2 版本切換到 Qt 6.3。

uj5u.com熱心網友回復:
根據QML 不支持 TreeViews的檔案標題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/494472.html
