From 08ca935c3b4669915e16941d2663e729fd07410e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 14 Aug 2013 16:03:33 +0200 Subject: [PATCH] FileDialogs example: added option to open the files Qt.openUrlExternally is a nice feature to remind users about, and gives this file dialog some purpose. Change-Id: I56e436f8b2f4362891450d57b6d9c36e26983513 Reviewed-by: Liang Qi --- examples/quick/dialogs/systemdialogs/FileDialogs.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/quick/dialogs/systemdialogs/FileDialogs.qml b/examples/quick/dialogs/systemdialogs/FileDialogs.qml index c8c5d13..e521988 100644 --- a/examples/quick/dialogs/systemdialogs/FileDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/FileDialogs.qml @@ -61,7 +61,12 @@ Rectangle { selectFolder: fileDialogSelectFolder.checked nameFilters: [ "Image files (*.png *.jpg)", "All files (*)" ] selectedNameFilter: "All files (*)" - onAccepted: { console.log("Accepted: " + fileUrls) } + onAccepted: { + console.log("Accepted: " + fileUrls) + if (fileDialogOpenFiles.checked) + for (var i = 0; i < fileUrls.length; ++i) + Qt.openUrlExternally(fileUrls[i]) + } onRejected: { console.log("Rejected") } } //! [filedialog] @@ -98,6 +103,10 @@ Rectangle { Binding on checked { value: fileDialog.selectMultiple } } CheckBox { + id: fileDialogOpenFiles + text: "Open Files After Accepting" + } + CheckBox { id: fileDialogVisible text: "Visible" Binding on checked { value: fileDialog.visible } -- 2.7.4