Revert "Try to use QSortFilterProxyModel via cxx-qt."
This reverts commit 325cf285fc.
This commit is contained in:
@@ -16,23 +16,20 @@ Rectangle {
|
||||
|
||||
signal fileClicked(string filePath)
|
||||
|
||||
// https://doc.qt.io/qt-6/qml-qtquick-treeview.html
|
||||
TreeView {
|
||||
id: fileSystemTreeView
|
||||
anchors.margins: 15
|
||||
|
||||
property int lastIndex: -1
|
||||
|
||||
model: FileSystemSortProxyModel {
|
||||
id: fs
|
||||
}
|
||||
model: FileSystem
|
||||
anchors.fill: parent
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
boundsMovement: Flickable.StopAtBounds
|
||||
clip: true
|
||||
|
||||
Component.onCompleted: {
|
||||
fs.setDirectory(root.rootDirectory)
|
||||
FileSystem.setDirectory(root.rootDirectory)
|
||||
fileSystemTreeView.expandRecursively(0, -1)
|
||||
}
|
||||
|
||||
@@ -125,13 +122,13 @@ Rectangle {
|
||||
text: qsTr("Set as root index")
|
||||
onTriggered: {
|
||||
console.log("Setting directory: " + treeDelegate.filePath)
|
||||
FileSystemSortProxyModel.setDirectory(treeDelegate.filePath)
|
||||
FileSystem.setDirectory(treeDelegate.filePath)
|
||||
}
|
||||
}
|
||||
Action {
|
||||
text: qsTr("Reset root index")
|
||||
onTriggered: {
|
||||
FileSystemSortProxyModel.setDirectory("")
|
||||
FileSystem.setDirectory("")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user