aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-14 15:02:50 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-13 09:37:56 +0000
commit658b0f610a71fab8c103b913d2cfd11c3c7c6bef (patch)
tree0d3abb07e0abd64d574cf11983e71b19f67aa87b /examples
parent829c4232906a91e6be94a3da3f10bd679056fd56 (diff)
Platform: add experimental StandardPaths
This complements the File/FolderDialog offering. Change-Id: I44a105724321092a6efc4126c8fb25f7d31b77e2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/texteditor/qml/texteditor.qml2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/quickcontrols2/texteditor/qml/texteditor.qml b/examples/quickcontrols2/texteditor/qml/texteditor.qml
index 5feae894..8cc33c6d 100644
--- a/examples/quickcontrols2/texteditor/qml/texteditor.qml
+++ b/examples/quickcontrols2/texteditor/qml/texteditor.qml
@@ -164,6 +164,7 @@ ApplicationWindow {
fileMode: FileDialog.OpenFile
selectedNameFilter: nameFilters[1]
nameFilters: ["Text files (*.txt)", "HTML files (*.html *.htm)"]
+ folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
onAccepted: document.load(file)
}
@@ -173,6 +174,7 @@ ApplicationWindow {
defaultSuffix: document.fileType
nameFilters: openDialog.nameFilters
selectedNameFilter: document.fileType === "txt" ? nameFilters[0] : nameFilters[1]
+ folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
onAccepted: document.saveAs(file)
}