我已经使用QML TreeView和TableView制作了一个工作应用程序。 Treeview是双窗格视图的左侧,TableView是双窗格视图的右侧(就像Windows资源管理器一样)。制作QML TreeView可调整大小
如何指定用户可以通过抓取视图和拖动的中心最边缘来调整两个视图的宽度?
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("File System")
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
Item {
id: dualPaneBox
anchors.fill: parent
TreeView {
id: viewDir
anchors.left: parent.left
anchors.right: viewFiles.left
anchors.margins: 50
height: parent.height
width: parent.width/2
model: fileDirModel
selection: selDir
TableViewColumn {
title: "Name"