aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/texteditor/qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-11 22:29:26 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-08-12 10:51:27 +0000
commit90842fdc865c3b7e9937bbd75f3fd5d74ec588ef (patch)
treeaa4900db16b0411f9895aaa5650aab8f4792df61 /examples/quickcontrols2/texteditor/qml
parentbb3453aeadf1aa3a53f2bf3c8d55b3ae3f4543b0 (diff)
texteditor: add fileName & fileType
'document.fileName' reads better than 'document.documentTitle', and 'document.fileType' can be set as the default suffix for the file save dialog. Change-Id: I935586296c91d3efdd5edea03d81c685e7edcab2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols2/texteditor/qml')
-rw-r--r--examples/quickcontrols2/texteditor/qml/texteditor.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/quickcontrols2/texteditor/qml/texteditor.qml b/examples/quickcontrols2/texteditor/qml/texteditor.qml
index a24a174b..ca4f196d 100644
--- a/examples/quickcontrols2/texteditor/qml/texteditor.qml
+++ b/examples/quickcontrols2/texteditor/qml/texteditor.qml
@@ -53,7 +53,7 @@ ApplicationWindow {
width: 1024
height: 600
visible: true
- title: document.documentTitle + " - Text Editor Example"
+ title: document.fileName + " - Text Editor Example"
Component.onCompleted: {
x = Screen.width / 2 - width / 2
@@ -169,7 +169,7 @@ ApplicationWindow {
FileDialog {
id: saveDialog
fileMode: FileDialog.SaveFile
- defaultSuffix: "html"
+ defaultSuffix: document.fileType
nameFilters: openDialog.nameFilters
onFileSelected: document.saveAs(file)
}