Reputation: 14102
I am trying to figure out how to setup the FileDialog of QtQuick.Dialogs 1.2
to select a folder instead of file(s) with no success so far. Here is my code. The user should select at least 1 file so that the FileDialog accept button works.
FileDialog {
id:dialogFile;
title: "Please select folder which contains positive training data";
folder: shortcuts.home;
onAccepted: {
console.log("User has selected " + dialogFile.folder);
}
}
Is there any settings/tricks to make this only browse for folder, something like the FolderBrowserDialog in .NET?
Upvotes: 5
Views: 5888
Reputation: 405
You should set your FileDialog
's selectFolder
property to true
.
See the documentation for further details.
Upvotes: 7