diff options
-rw-r--r-- | examples/quickcontrols2/texteditor/qml/texteditor.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/quickcontrols2/texteditor/qml/texteditor.qml b/examples/quickcontrols2/texteditor/qml/texteditor.qml index 8cc33c6d..2247e8f1 100644 --- a/examples/quickcontrols2/texteditor/qml/texteditor.qml +++ b/examples/quickcontrols2/texteditor/qml/texteditor.qml @@ -162,7 +162,7 @@ ApplicationWindow { FileDialog { id: openDialog fileMode: FileDialog.OpenFile - selectedNameFilter: nameFilters[1] + selectedNameFilter.index: 1 nameFilters: ["Text files (*.txt)", "HTML files (*.html *.htm)"] folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation) onAccepted: document.load(file) @@ -173,7 +173,7 @@ ApplicationWindow { fileMode: FileDialog.SaveFile defaultSuffix: document.fileType nameFilters: openDialog.nameFilters - selectedNameFilter: document.fileType === "txt" ? nameFilters[0] : nameFilters[1] + selectedNameFilter.index: document.fileType === "txt" ? 0 : 1 folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation) onAccepted: document.saveAs(file) } |