QmlDesigner: Expand folders on search query change in Assets view

Fixes: QDS-14299
Change-Id: I3b7975557ec28660b3306fbdcc44afd2bc90bfc0
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
This commit is contained in:
Shrief Gabr
2024-12-19 11:16:18 +02:00
parent c5be8e2169
commit d611782566

View File

@@ -46,6 +46,16 @@ TreeView {
readonly property int lastRow: root.rows - 1 readonly property int lastRow: root.rows - 1
property var __createdDirectories: [] property var __createdDirectories: []
onExpanded:(row) => {
let index = root.__modelIndex(row)
assetsModel.saveExpandState(assetsModel.filePath(index), true)
}
onCollapsed:(row) => {
let index = root.__modelIndex(row)
assetsModel.saveExpandState(assetsModel.filePath(index), false)
}
rowHeightProvider: (row) => { rowHeightProvider: (row) => {
if (row <= root.rootPathRow) if (row <= root.rootPathRow)
return 0 return 0
@@ -359,8 +369,6 @@ TreeView {
let row = root.rowAtIndex(index) let row = root.rowAtIndex(index)
assetsModel.saveExpandState(root.currentFilePath, expand)
if (expand) if (expand)
root.expand(row) root.expand(row)
else else